/* ============================================================
   报单系统 - Bento Grid（便当盒布局）
   浅色 zinc 色板 / 不规则网格 / rounded-2xl / 柔和阴影 + 悬停上浮微放大
   与便当盒一致：大卡片放主要内容，小卡片放次要信息，间隙统一
   ============================================================ */
:root {
  --bg: #f6f6f7;              /* 页面底色 zinc-50/100 */
  --card: #ffffff;            /* 卡片 */
  --panel: #fafafa;           /* 内嵌扁平面板（非卡片） */
  --text: #18181b;            /* 主要文字 zinc-900 */
  --text-2: #52525b;          /* 次要文字 zinc-600 */
  --muted: #a1a1aa;           /* 弱化文字 zinc-400 */
  --line: #ececef;            /* 卡片描边（zinc-100 略深） */
  --line-2: #e4e4e7;          /* 输入框描边 zinc-200 */

  --primary: #18181b;         /* 主按钮：bg-zinc-900 text-white */
  --primary-2: #27272a;
  --on-primary: #ffffff;
  --soft: #f4f4f5;            /* 次级底 zinc-100 */

  --focus: #3b82f6;           /* focus:border-blue-500 */
  --ring: rgba(59, 130, 246, .20);  /* focus:ring-blue-500/20 */

  --danger: #e11d48;
  --ok: #059669;

  /* 便当盒强调渐变（彩色卡片） */
  --grad-a: linear-gradient(135deg, #3b82f6, #06b6d4);   /* 蓝 → 青 */
  --grad-b: linear-gradient(135deg, #f97316, #ec4899);   /* 橙 → 粉 */
  --grad-c: linear-gradient(135deg, #22c55e, #06b6d4);   /* 绿 → 青 */

  --radius: 16px;             /* rounded-2xl */
  --radius-sm: 12px;          /* rounded-xl */
  --gap: 16px;                /* gap-4：全局统一间隙 */

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .06);
  --shadow-md: 0 4px 14px -4px rgba(24, 24, 27, .10);
  --shadow-lg: 0 8px 30px rgba(24, 24, 27, .10);   /* hover 广阔的柔和阴影 */

  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Courier New", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);             /* ease-out，无弹跳 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* 极轻的暖光背景，让白色便当盒浮起来（不用玻璃态） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(59, 130, 246, .07), transparent 60%),
    radial-gradient(800px 400px at 98% -6%, rgba(6, 182, 212, .06), transparent 62%);
}
body > * { position: relative; z-index: 1; }

a { color: inherit; }

/* 焦点样式：蓝色平滑光环 */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, label:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--focus);
}

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

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}
.brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-logo {
  height: 34px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
}
.brand-fallback { margin-right: 2px; }
.nav {
  display: flex;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 1px;
}
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  display: inline-block;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  background: transparent;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.nav-link:hover { background: var(--soft); color: var(--text); }
.nav-link.active { background: var(--primary); color: var(--on-primary); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 0;
}
.who {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.logout:hover { background: var(--soft); color: var(--danger); }

/* 角色交叉入口（用户区 → 管理后台）：跟日常入口拉开一点，别混成一串 */
.nav-link.nav-cta {
  color: var(--text);
  background: var(--soft);
  border: 1px solid var(--line-2);
  margin-left: 6px;
}
.nav-link.nav-cta:hover { background: #e4e4e7; color: var(--text); }

/* ---------- 主体 ---------- */
.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--text);
}
.tip {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

/* ---------- 便当盒网格（Bento Grid） ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  grid-auto-rows: minmax(92px, auto);
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
/* 悬停：平滑上浮 + 微放大 + 阴影由紧凑变宽广 */
.tile:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-2);
}
.tile:active { transform: translateY(-1px) scale(.99); }

.tile-num {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.tile-label { font-size: 14px; color: var(--text-2); }
.tile-sub { font-size: 12.5px; color: var(--muted); }

/* 大卡片：跨 2 列 2 行，承载主要信息（可带渐变底） */
.tile-lg { grid-column: span 2; grid-row: span 2; }
.tile-lg .tile-num { font-size: 46px; }
.tile-lg .tile-label { font-size: 15px; }
/* 中卡片：跨 2 列 */
.tile-md { grid-column: span 2; }

/* 彩色强调卡：白字，正文用半透明白保证对比度 */
.tile.tile-accent,
.tile-accent {
  color: #ffffff;
  border-color: transparent;
  background-image: var(--grad-a);
  box-shadow: 0 8px 24px -14px rgba(59, 130, 246, .65);
}
.tile-accent .tile-num,
.tile-accent .tile-label,
.tile-accent .tile-sub { color: #ffffff; }
.tile-accent .tile-sub,
.tile-accent .tile-label { opacity: .88; }
.tile-accent:hover { box-shadow: 0 16px 40px -14px rgba(59, 130, 246, .6); }
.tile-accent-2 { background-image: var(--grad-b); box-shadow: 0 8px 24px -14px rgba(236, 72, 153, .6); }
.tile-accent-3 { background-image: var(--grad-c); box-shadow: 0 8px 24px -14px rgba(34, 197, 94, .6); }

/* 卡片内图标：group-hover 独立响应（放大 + 换色） */
.tile-ico {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  background: var(--soft);
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.tile:hover .tile-ico { transform: scale(1.1); }
.tile:not(.tile-accent):hover .tile-ico { background: #eef2ff; }
.tile-accent .tile-ico { background: rgba(255, 255, 255, .22); }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-arrow { color: var(--muted); font-size: 18px; line-height: 1; transition: transform .2s var(--ease); }
.tile:hover .tile-arrow { transform: translateX(3px); }
.tile-accent .tile-arrow { color: rgba(255, 255, 255, .85); }

/* ---------- 提示条 ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-weight: 500;
  font-size: 15px;
  border: 1px solid transparent;
}
.alert-ok  { background: #ecfdf5; color: var(--ok); border-color: #a7f3d0; }
.alert-err { background: #fff1f2; color: var(--danger); border-color: #fecdd3; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--text);
}
.req { color: var(--danger); }
.input {
  width: 100%;
  border: 1px solid var(--line-2);
  outline: none;
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.input::placeholder { color: var(--muted); }
.input:focus {
  background: var(--card);
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--ring);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.input-file { padding: 10px; background: var(--panel); }
.input-file::file-selector-button {
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-right: 10px;
  font-family: inherit;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.input-file::file-selector-button:hover { background: var(--soft); border-color: #d4d4d8; }
.mono { font-family: var(--mono); }
.strong { font-weight: 600; }
.muted { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 22px 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  outline: none;
  cursor: pointer;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover {
  background: var(--primary-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn:active { transform: translateY(0) scale(.96); box-shadow: var(--shadow-sm); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-sm { font-size: 13px; padding: 6px 14px; border-radius: var(--radius-sm); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #be123c; }
.btn-ghost {
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { background: var(--soft); color: var(--text); border-color: #d4d4d8; }
.btn-ghost:active { transform: translateY(0) scale(.96); }

/* ---------- 收款码上传 ---------- */
.upload-row {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
}
.upload-item { flex: 1 1 220px; }
.qr-preview {
  display: none;
  margin-top: 10px;
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line-2);
  padding: 6px;
}
.qr-preview.shown { display: block; }

/* ---------- 报单实时预览（扁平内嵌面板，不做嵌套卡片） ---------- */
.preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 15px;
  box-shadow: none;
}
.preview-title { font-size: 15px; margin-bottom: 6px; color: var(--text); }
.preview-title b { font-family: var(--mono); }
.warn-text { color: var(--danger); }
.preview-list { list-style: none; max-height: 220px; overflow-y: auto; }
.preview-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-2);
}
.preview-list li:last-child { border-bottom: none; }
.preview-bad { color: var(--danger); font-size: 13px; margin-top: 6px; }

/* 报单实时预览：型号数量小标签 */
.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pv-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.pv-chip i {
  font-style: normal;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

/* ---------- 报单校验：提交前逐行标注 ---------- */
.preview-list li.pv-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.pv-ln {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pv-why { font-style: normal; font-size: 12.5px; color: var(--text-2); }
.pv-error { background: #fef2f2; }
.pv-error .pv-why { color: #dc2626; }
.pv-warn { background: #fffbeb; }
.pv-warn .pv-why { color: #b45309; }
.pv-dup { background: #fffbeb; }
.pv-dup .pv-why { color: #b45309; }
.pv-chip-bad { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.pv-chip-bad i { color: #dc2626; }
.pv-chip-warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.pv-chip-warn i { color: #b45309; }
/* 有错行时提交按钮置灰（仍可点击但会提示，避免用户以为按钮坏了） */
.btn-blocked { opacity: .5; cursor: not-allowed; }

/* 提交被拒：逐行错误清单 */
.table-check td { vertical-align: top; }
.table-check .check-reason { color: #dc2626; font-size: 13.5px; line-height: 1.6; }
.table-check tr.row-error { background: #fef2f2; }
.table-check tr.row-warn { background: #fffbeb; }
.table-check tr.row-warn .check-reason { color: #b45309; }

/* 提醒模式：型号不在库的确认清单 */
.check-warn-list {
  list-style: none;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: #92400e;
  line-height: 1.7;
}
.check-warn-list li { padding: 3px 0; }
.check-warn-list li b { color: #b45309; }

/* 报单格式说明行 */
.tip-line {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.7;
}
.tip-line code {
  font-family: var(--mono);
  background: var(--soft);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text-2);
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  min-width: 640px;
}
.table th, .table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 600;
  background: var(--panel);
  white-space: nowrap;
}
.table th:first-child { border-top-left-radius: var(--radius-sm); }
.table th:last-child  { border-top-right-radius: var(--radius-sm); }
.table tbody tr { transition: background-color .2s var(--ease); }
.table tbody tr:hover { background: var(--panel); }
.table tbody tr:last-child td { border-bottom: none; }
.table td form { margin: 0; }
.table .mono { font-variant-numeric: tabular-nums; }

/* ---------- 富文本编辑器 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.tb-btn {
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: transform .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.tb-btn:hover { background: var(--soft); color: var(--text); transform: translateY(-1px); }
.tb-btn:active { transform: translateY(0) scale(.96); }
.tb-italic { font-style: italic; }
.tb-underline { text-decoration: underline; }
.tb-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tb-primary:hover { background: var(--primary-2); color: var(--on-primary); }
.tb-sep { width: 1px; background: var(--line-2); margin: 2px 4px; }
.editor {
  min-height: 320px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 16px;
  line-height: 1.8;
  background: var(--panel);
  outline: none;
  margin-bottom: 16px;
  word-break: break-word;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.editor:focus { background: var(--card); border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.editor h2, .editor h3 { margin: 14px 0 8px; font-weight: 600; }
.editor ul, .editor ol { padding-left: 26px; margin: 8px 0; }
.rich-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 60px;
  line-height: 1.8;
  word-break: break-word;
  background: var(--panel);
  color: var(--text-2);
  box-shadow: none;
}
.rich-preview img, .editor img {
  max-width: min(100%, 340px) !important;
  width: auto;
  height: auto !important;
  display: block;
  margin: 8px auto;
  border-radius: var(--radius-sm);
}
.rich-preview:empty::before { content: "（编辑内容后此处实时预览）"; color: var(--muted); }

/* ---------- 登录 / 注册页 ---------- */
.auth-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  background:
    radial-gradient(760px 380px at 50% -8%, rgba(59, 130, 246, .10), transparent 62%),
    var(--bg);
}
.auth-wrap { width: 100%; max-width: 460px; }
.auth-wrap-wide { max-width: 600px; }
.auth-title {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
  color: var(--text);
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 18px;
}
.auth-brand-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 24px;
  background-image: var(--grad-a);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(59, 130, 246, .8);
  overflow: hidden;
  transition: transform .2s var(--ease);
}
.auth-brand:hover .auth-brand-ico { transform: scale(1.06); }
.auth-logo { display: block; height: 32px; width: auto; max-width: 180px; object-fit: contain; }
.auth-card { padding: 24px; }
/* 选项卡（登录 / 注册切换） */
.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--soft);
  border-radius: var(--radius-sm);
  padding: 5px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
a.auth-tab:hover { color: var(--text); background: rgba(255, 255, 255, .7); }
.auth-tab.active {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
/* 分组小标题 */
.auth-section {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  margin: 4px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.auth-section + .auth-section,
.field + .auth-section,
.field-grid + .auth-section { margin-top: 20px; }
/* 双列字段栅格 */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-span { grid-column: 1 / -1; }
.auth-submit { padding: 13px 0; font-size: 16px; margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 16px; color: var(--text-2); font-size: 14px; }
.auth-tip { text-align: center; margin-top: 18px; color: var(--muted); font-size: 13.5px; }
.auth-foot a { color: #2563eb; font-weight: 500; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* ---------- 管理后台：筛选 / 标签 / 批量栏 ---------- */
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-row .select { width: auto; min-width: 140px; flex: 0 0 auto; }
.filter-input { flex: 1 1 160px; width: auto; }
/* 报单人搜索框：够用就好，别把「单号搜索」挤没 */
.filter-input-sm { flex: 0 1 200px; }
.filter-row .btn-sm { align-self: stretch; }
.role-tag {
  display: inline-block;
  background: var(--soft);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.qr-thumbs { display: flex; gap: 6px; align-items: center; }
.qr-thumbs img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line-2);
  display: block;
}
.table-users { min-width: 900px; }

/* ---------- 状态标签 / 选项卡 / 列表头 ---------- */
.status-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pending  { background: #fffbeb; color: #b45309; }   /* 待入库 */
.status-instock  { background: #eff6ff; color: #1d4ed8; }   /* 已入库 */
.status-settling { background: var(--soft); color: var(--text-2); }  /* 待结算 */
.status-settled  { background: #ecfdf5; color: #047857; }   /* 已结算 */

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.list-head .card-title { margin-bottom: 0; }

.limit-switch, .range-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.limit-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.limit-btn:hover { background: var(--soft); color: var(--text); transform: translateY(-1px); }
.limit-btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.tab:hover { background: var(--soft); color: var(--text); transform: translateY(-1px); }
.tab.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.range-switch { margin-bottom: 14px; }

/* ---------- 我的（旧结构兜底） ---------- */
.profile-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.avatar-box { text-align: center; }
.avatar {
  width: 84px;
  height: 84px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--soft);
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  color: var(--text-2);
}
.avatar-form { margin-top: 10px; }
.avatar-btn { display: inline-block; cursor: pointer; }
.profile-info { flex: 1 1 240px; }
.profile-row {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  align-items: baseline;
}
.profile-row:last-child { border-bottom: none; }
.profile-key { color: var(--text-2); flex: 0 0 60px; font-size: 14px; }
.kefu-box { text-align: center; padding: 10px 0 4px; }
.kefu-qr {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line-2);
  padding: 8px;
}
.price-text { color: #2563eb; }

/* ---------- 管理端表格小控件 ---------- */
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 2px 0; }
.input-mini {
  width: auto;
  min-width: 70px;
  max-width: 130px;
  padding: 7px 10px;
  font-size: 14px;
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.input-mini:focus { background: var(--card); border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); outline: none; }
select.input-mini { min-width: 86px; }
.nowrap { white-space: nowrap; }

/* 后台宽屏：容器放宽 + 表格压缩 */
.scope-admin .main { max-width: 1680px; }
.scope-admin .table-orders-admin { min-width: 0; }
.scope-admin .table-orders-admin th,
.scope-admin .table-orders-admin td { padding: 8px; }
.scope-admin .table-orders-admin { font-size: 13.5px; }
.table-orders-admin .input-mini { min-width: 0; font-size: 13px; padding: 6px 8px; }
.table-orders-admin input[name="model"]  { width: 150px; }
.table-orders-admin input[name="quantity"] { width: 70px; }
.table-orders-admin select[name="status"] { width: 92px; min-width: 0; }
.table-orders-admin .btn-sm { padding: 5px 10px; font-size: 12.5px; }
.cell-date { font-size: 12.5px; }
/* 日期列拆成两个时间标记：上行=报单时间，下行=入库时间（小一号灰字）。
   .dt-on 标出当前「按哪个时间筛选」，省得筛完不知道自己在看哪个口径。 */
.cell-date .dt-line { line-height: 1.45; }
.cell-date .dt-sub { font-size: 11px; color: var(--muted); opacity: .85; }
.cell-date .dt-on { color: inherit; }
.cell-date .dt-line.dt-on { font-weight: 600; }
.cell-date .dt-sub.dt-on { opacity: 1; font-weight: 600; color: var(--text); }

/* 手改入库时间：折在 <details> 里，平时只占一行小字，不把日期列撑宽。
   datetime-local 控件在窄屏会给内容列顶出横向滚动，所以宽度写死 + min-width:0。 */
.dt-edit { margin-top: 4px; white-space: normal; }
.dt-edit > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  font-size: 11px;
  color: var(--text-2);
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  user-select: none;
}
.dt-edit > summary::-webkit-details-marker { display: none; }
.dt-edit > summary:hover { color: var(--text); border-color: var(--line-2); }
.dt-edit[open] > summary { color: var(--text); }
.dt-edit .dt-input {
  display: block;
  margin-top: 5px;
  width: 178px;
  max-width: 100%;
  min-width: 0;
  font-size: 12px;
  padding: 4px 6px;
  box-sizing: border-box;
}
.dt-edit .dt-tip {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
  color: var(--muted);
  max-width: 190px;
}
.cell-remark { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 桌面端铺满容器：用 width:100% 而不是 min-width:0
   （min-width:0 权重比移动端那条 min-width:780px 高，会把窄屏的横向滚动压掉导致内容折行） */
.scope-admin .table-users { width: 100%; min-width: 0; }
.scope-admin .table-users th,
.scope-admin .table-users td { padding: 8px; }
/* 窄屏下账号/银行卡/角色/报单数等无空格内容会被 word-break 折成竖排，这些列必须 nowrap */
.scope-admin .table-users td.strong,
.scope-admin .table-users td.mono,
.scope-admin .table-users td.nowrap,
.scope-admin .table-users td .role-tag,
.scope-admin .table-users td.cell-count { white-space: nowrap; }
/* 桌面端也保持账号/银行卡整行不断（.table td 的 break-word 会折长数字串） */
.scope-admin .table-users td.strong,
.scope-admin .table-users td.mono { word-break: keep-all; }
/* 窄屏：让账号/银行卡列拿到足够宽度，长数字串才不会折行 */
@media (max-width: 720px) {
  .scope-admin .table-users th:nth-child(2),
  .scope-admin .table-users td:nth-child(2) { min-width: 116px; }
  .scope-admin .table-users th:nth-child(6),
  .scope-admin .table-users td:nth-child(6) { min-width: 168px; }
}

/* ---------- 查单对账：批量操作栏 + 收款信息 ---------- */
.batch-bar {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 14px;
  box-shadow: none;
}
.batch-bar form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.batch-tip { font-size: 14px; color: var(--text-2); }
.batch-tip b { color: var(--text); font-family: var(--mono); }
.batch-grp { display: inline-flex; align-items: center; gap: 6px; }
.batch-grp-end { margin-left: auto; }   /* 保存 / 删除 靠右，和上面两组拉开，减少误点 */
.batch-amt { width: 96px; }
.batch-bar .select { width: auto; min-width: 112px; }
.batch-bar .btn:disabled { opacity: .45; cursor: not-allowed; }
.col-check { width: 36px; text-align: center; }
.col-check input, td.col-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.user-link { color: #2563eb; text-decoration: none; font-weight: 500; }
.user-link:hover { text-decoration: underline; }

.pay-card { background: var(--card); }
.pay-grid { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.pay-fields { flex: 1 1 260px; min-width: 240px; }
.pay-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.pay-row:last-child { border-bottom: none; }
.pay-k { color: var(--text-2); flex: 0 0 84px; white-space: nowrap; }
/* 「待结算金额」：打款前要看的那一行，跟上面的账号信息用虚线上边线隔开 */
.pay-row-amt { margin-top: 2px; padding-top: 9px; border-top: 1px dashed var(--line-2); }
.pay-amt { color: #e11d48; font-size: 16px; font-weight: 700; }
.pay-amt-zero { color: var(--muted); font-weight: 600; }
.pay-amt-cnt { font-style: normal; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.pay-qrs { flex: 0 0 auto; }
.qr-thumbs a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; }
.qr-thumbs a img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line-2); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.qr-thumbs a:hover img { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-md); }
.qr-thumbs a span { font-size: 12px; color: var(--text-2); }

/* ---------- 「我的」页：便当盒布局 ---------- */
.me-hero {
  display: flex; align-items: center; gap: 16px;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.me-hero:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-lg); }
.me-avatar-wrap { position: relative; flex: 0 0 auto; }
.me-avatar {
  width: 68px; height: 68px; border-radius: 999px; object-fit: cover;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
}
.me-avatar-default {
  display: flex; align-items: center; justify-content: center;
  background-image: var(--grad-a);
  color: #fff; font-size: 26px; font-weight: 600;
}
.me-avatar-form { position: absolute; right: -2px; bottom: -2px; margin: 0; }
.me-avatar-edit {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line-2); font-size: 12px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.me-avatar-edit:hover { border-color: var(--focus); transform: scale(1.1); }
.me-hero-info { min-width: 0; }
.me-name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.me-role { font-size: 13px; color: var(--text-2); margin-top: 3px; font-weight: 500; }
.me-phone { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* 状态区：便当盒网格 */
.me-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); grid-auto-rows: minmax(86px, auto); }
.me-pill {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; color: var(--text-2); text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.me-pill b { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--text); line-height: 1.1; }
.me-pill:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.me-pill:active { transform: translateY(-1px) scale(.99); }
/* 「全部」为大卡片：跨 2 列 2 行 + 渐变 */
.me-pill.me-pill-lg {
  grid-column: span 2; grid-row: span 2;
  justify-content: space-between;
  align-items: flex-start;
  background-image: var(--grad-a);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 24px -14px rgba(59, 130, 246, .65);
}
.me-pill.me-pill-lg:hover { box-shadow: 0 16px 40px -14px rgba(59, 130, 246, .6); }
.me-pill.me-pill-lg b { font-size: 46px; color: #ffffff; }
.me-pill.me-pill-lg .tile-ico { background: rgba(255, 255, 255, .22); }
.me-pill.me-pill-lg .me-pill-body { color: rgba(255, 255, 255, .9); }
.me-pill-body { display: flex; flex-direction: column; gap: 2px; }
.me-pill-body b { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--text); line-height: 1.1; }
.me-pill:hover .tile-ico { transform: scale(1.1); }
.me-pill.active { border-color: var(--text); box-shadow: var(--shadow-md); }
.me-pill.active:not(.me-pill-lg) { background: var(--soft); }
.me-pill.active:not(.me-pill-lg) span { color: var(--text); font-weight: 600; }

.me-menu { padding: 6px; }
.me-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 15px;
  cursor: pointer; list-style: none;
  transition: background-color .2s var(--ease);
}
.me-item:hover { background: var(--panel); }
.me-item summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.me-item summary::-webkit-details-marker { display: none; }
.me-ico {
  font-size: 17px; width: 34px; height: 34px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); border-radius: var(--radius-sm);
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.me-item:hover .me-ico { transform: scale(1.1); background: #eef2ff; }
.me-label { flex: 1; font-weight: 500; }
.me-arrow { color: var(--muted); font-size: 18px; line-height: 1; transition: transform .2s var(--ease), color .2s var(--ease); }
.me-item[open] > summary .me-arrow { transform: rotate(90deg); }
.me-item[open] > summary .me-label { font-weight: 600; }

/* 展开区：扁平内嵌面板（避免卡片嵌套） */
.me-sub {
  margin: 10px 4px 8px 46px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: none;
  animation: meExpand .2s var(--ease);
  transform-origin: top;
}
@keyframes meExpand {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.me-sub .field { margin-bottom: 12px; }
.me-sub .field .label { font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.me-sub .btn { margin-top: 6px; }
.me-sub .kefu-box { padding: 6px 0 2px; }
.me-qr-tip { margin: 0 0 12px; font-size: 13px; }
.me-sub .profile-row { padding: 7px 0; font-size: 14px; }

/* ---------- 后台：Logo 上传预览 ---------- */
.logo-preview-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.logo-preview-lg {
  height: 72px;
  min-width: 72px;
  max-width: 260px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 26px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.logo-preview-lg img { display: block; height: 52px; width: auto; max-width: 240px; object-fit: contain; }
.logo-preview-text { display: flex; flex-direction: column; gap: 2px; }
.logo-preview-text strong { font-size: 16px; color: var(--text); }
.logo-form { display: inline-block; vertical-align: top; }
.logo-clear { display: inline-block; margin-left: 8px; }

/* ---------- 滚动条 ---------- */
* { scrollbar-color: #d4d4d8 transparent; }

/* ---------- 移动端 / 平板适配 ---------- */
@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento .tile-lg { grid-column: span 2; grid-row: span 1; }
  .bento .tile-md { grid-column: span 2; }
  .me-pills { grid-template-columns: repeat(2, 1fr); }
  .me-pill.me-pill-lg { grid-column: span 2; grid-row: span 1; }
  .me-pill.me-pill-lg b { font-size: 34px; }
}

/* 顶栏一行放不下时（平板竖屏 / 小笔记本）把导航挪到第二行独占一条。
   宁可顶栏高一点，也别把「管理后台」「退出」挤出屏幕外——
   导航横着滚动是没有提示的，多数人根本不知道右边还有东西 */
@media (max-width: 1000px) {
  .topbar-inner { flex-wrap: wrap; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .topbar-right { order: 2; }
  .nav { order: 3; flex: 1 1 100%; width: 100%; }
}

@media (max-width: 640px) {
  .topbar-inner { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 16.5px; }
  .brand-logo { height: 28px; max-width: 120px; }
  /* 手机上宁可折成两行，也别让后面几个入口藏在横向滚动里（没有任何提示） */
  .nav { padding-bottom: 2px; flex-wrap: wrap; overflow: visible; }
  .topbar-right { gap: 8px; }
  .nav-link { padding: 6px 9px; font-size: 13.5px; }
  .nav-cta { padding: 6px 9px; font-size: 13.5px; }
  .who { display: inline; font-size: 12.5px; max-width: 42vw; }
  .main { padding: 14px 12px 40px; gap: 14px; }
  .card { padding: 18px 14px; }
  .card-title { font-size: 17px; }
  .bento { gap: 12px; grid-auto-rows: minmax(78px, auto); }
  .tile { padding: 14px; }
  .tile-lg .tile-num { font-size: 36px; }
  .tile-num { font-size: 24px; }
  /* 安全日志统计卡：窄屏下右上角小字放不下，藏掉（下方 sub 已有说明） */
  .bento-row .tile-head .tile-sub { display: none; }
  .bento-row .tile-num { font-size: 28px; }

  .auth-title { font-size: 20px; }
  .auth-body { padding: 26px 14px; }
  .auth-brand { font-size: 18px; margin-bottom: 14px; }
  .auth-brand-ico { min-width: 44px; height: 44px; border-radius: var(--radius-sm); }
  .auth-logo { height: 26px; max-width: 150px; }
  .auth-card { padding: 18px 15px; }
  .auth-tabs { margin-bottom: 16px; }
  .auth-tab { padding: 9px 0; font-size: 14.5px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .upload-row { flex-direction: column; }
  .upload-row .upload-item { flex: 0 0 auto; }

  /* 表格：压缩内边距，可横向滑动；窄表（3列）完整放下不滑动 */
  .table { min-width: 520px; font-size: 13.5px; }
  .table th, .table td { padding: 8px; }
  .table td { word-break: break-word; }
  .table-narrow { min-width: 0; }
  .preview-list li { word-break: break-all; }

  /* 后台在手机上恢复横向滑动，避免挤成一团
     注意：这些 min-width 必须 !important —— 桌面那条 `.scope-admin .table-users { min-width: 0 }`
     选择器权重更高（两个类），不加的话窄屏横向滑动会失效、内容全被折行 */
  .scope-admin .table-orders-admin { min-width: 760px !important; }
  .scope-admin .table-users { min-width: 780px !important; }
  .scope-admin .table-logs { min-width: 860px !important; }
  /* 行情页四张窄表在手机上不挤竖排，恢复横向滑动 */
  .page-market .table-narrow { min-width: 620px !important; }
  .page-market .table-prices { min-width: 620px !important; }
  .page-market .table-prices td:nth-child(2) { white-space: nowrap; }
  /* 可疑 IP 表（5 列）也要能横向滑动，否则 IP 会被挤成竖排字符 */
  .scope-admin .table-risk-ip { min-width: 620px; }
  .cell-remark { max-width: 120px !important; }
  .filter-row .select { min-width: 0; flex: 1 1 40%; }
  .filter-input { flex: 1 1 100%; }

  .me-hero { padding: 16px 14px; gap: 12px; }
  .me-avatar { width: 58px; height: 58px; }
  .me-pills { gap: 12px; }
  .me-pill { padding: 12px; }
  .me-pill b { font-size: 20px; }
  .me-pill.me-pill-lg b { font-size: 30px; }
  .me-sub { margin: 8px 0 8px 0; padding: 14px; }
}

/* ---------- 账号水印：用户界面平铺，截图外发可追溯到人 ---------- */
.wm {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 130px;
  align-items: center;
  justify-items: center;
  user-select: none;
  -webkit-user-select: none;
}
.wm span {
  transform: rotate(-22deg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(24, 24, 27, .055);
  white-space: nowrap;
}

/* 顶栏账号旁的姓名 */
.who-name { font-style: normal; font-weight: 500; color: var(--text-2); margin-left: 6px; }
.who-name::before { content: "· "; }

/* 查单对账：报单人列的姓名小字 */
.user-name { display: block; font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.3; }

/* ---------- 结算行情：最新价 + 可展开历史价格 ---------- */
.settle-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--danger);
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.settle-note::before { content: '※'; flex: none; font-weight: 700; }
@media (max-width: 640px) {
  .settle-note { font-size: 13.5px; padding: 9px 12px; }
}

.mh-list { display: flex; flex-direction: column; }
.mh-model { padding: 14px 2px; border-top: 1px solid var(--line); }
.mh-model:first-child { border-top: none; padding-top: 4px; }
.mh-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mh-name { font-size: 16px; font-weight: 600; color: var(--text); word-break: break-all; }
.mh-meta { display: flex; align-items: baseline; gap: 10px; flex: 0 0 auto; }
.mh-date { font-size: 13px; color: var(--muted); }
.mh-price { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--text); }
.mh-price i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.mh-hist { margin-top: 6px; }
.mh-hist summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color .2s var(--ease);
}
.mh-hist summary::-webkit-details-marker { display: none; }
.mh-hist summary::before { content: "\25B8"; font-size: 11px; transition: transform .2s var(--ease); }
.mh-hist[open] summary::before { transform: rotate(90deg); }
.mh-hist summary:hover { color: var(--text); }
.mh-hist ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 8px 12px;
  background: var(--panel);
  border-radius: var(--radius-sm);
}
.mh-hist li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; color: var(--text-2); }
.mh-hist li + li { border-top: 1px dashed var(--line-2); }
.mh-h-date { flex: 0 0 auto; }
.mh-h-price { font-family: var(--mono); font-weight: 600; color: var(--text); }

/* ---------- 结算行情：迷你走势图（Sparkline） ---------- */
/* 说明：SVG 用 preserveAspectRatio="none" 横向铺满，
   所以线条宽度靠 vector-effect:non-scaling-stroke 锁定，不随容器宽度变形。
   末端圆点用绝对定位的 HTML 元素画 —— SVG 里的 <circle> 横向拉伸会变成椭圆。*/
.spark {
  margin-top: 10px;
  padding: 10px 12px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.spark-chart { position: relative; height: 56px; }
.spark-svg { display: block; width: 100%; height: 56px; overflow: visible; }
.spark-area { color: inherit; }
.spark-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.spark-base {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: .5;
  vector-effect: non-scaling-stroke;
}
.spark-mark { stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-dot {
  position: absolute;
  right: -4px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px var(--panel);
}
/* A股习惯：红涨绿跌 */
.spark-up { color: var(--danger); }
.spark-down { color: var(--ok); }
.spark-flat { color: var(--muted); }

.spark-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.spark-trend { font-weight: 600; display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; }
.spark-arrow { font-style: normal; font-size: 10px; }
.spark-trend em { font-style: normal; font-weight: 500; opacity: .75; font-family: var(--mono); }
.spark-range { color: var(--muted); font-family: var(--mono); flex: 0 0 auto; }
/* 持平态把文字从灰色提回次要灰，避免看不清 */
.spark-flat .spark-trend { color: var(--text-2); }
.spark-none { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .spark { padding: 9px 10px 7px; }
  .spark-chart, .spark-svg { height: 48px; }
  .spark-foot { font-size: 11.5px; gap: 8px; }
  .spark-range { font-size: 11px; }
}

@media (max-width: 640px) {
  .wm { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 110px; }
  .wm span { font-size: 12px; }
}

/* ---------- 后台设置：卡片内小节标题与表单分隔 ---------- */
.sub-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.form-sep {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- 后台对账：型号分行编辑（每个型号一行，各自带数量） ---------- */
.model-form { min-width: 268px; }
.md-list { display: flex; flex-direction: column; gap: 6px; }
.md-row { display: flex; align-items: center; gap: 6px; }
.md-row input[name="models[]"] { flex: 1 1 auto; min-width: 108px; }
.md-row .md-qty { flex: 0 0 68px; text-align: center; }
.md-x { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.md-del {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.md-del:hover { color: var(--danger); border-color: #fecdd3; background: #fff1f2; }
.md-add {
  align-self: flex-start;
  margin-top: 2px;
  padding: 4px 10px;
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.md-add:hover { background: var(--soft); color: var(--text); }

/* ---------- 后台对账：当日结算金额 ---------- */
.cell-amount { white-space: nowrap; }
.cell-amount .amt {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: help;
}
.cell-amount .amt-warn {
  display: block;
  font-size: 11.5px;
  color: var(--danger);
  line-height: 1.4;
  max-width: 220px;
  white-space: normal;
  word-break: break-all;
}
.tile-money { background-image: var(--grad-c); border-color: transparent; color: #fff; }
.tile-money .tile-num,
.tile-money .tile-label,
.tile-money .tile-sub { color: #fff; }
.tile-money .tile-num.money { font-family: var(--mono); }

/* ---------- 型号别名 / 关键词 ---------- */
.alias-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alias-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 1px 4px 1px 9px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--text-2);
  white-space: nowrap;
}
.alias-del-form { display: inline; }
.alias-x {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 1px 5px;
  border-radius: 999px;
  color: var(--muted);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.alias-x:hover { background: var(--line); color: var(--danger); }
.amt-alias {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  max-width: 130px;
  white-space: normal;
  word-break: break-all;
  cursor: help;
}
.try-box {
  font-size: 13.5px;
  line-height: 1.7;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
}
.try-box b { font-weight: 700; }
.try-ok { border-color: rgba(22,163,74,.35); background: rgba(22,163,74,.07); color: var(--ok); }
.try-bad { border-color: rgba(220,38,38,.32); background: rgba(220,38,38,.06); color: var(--danger); }
@media (max-width: 640px) {
  .amt-alias, .cell-amount .amt-warn { max-width: 96px; }
}

/* ---------- 用户页公告：紧凑可折叠条（替代整张 card，节省首屏空间） ---------- */
.notice {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  cursor: pointer;
  list-style: none;
  min-height: 38px;
  transition: background-color .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.notice-bar::-webkit-details-marker { display: none; }
.notice-bar:hover { background: var(--soft); }
.notice-ico { font-size: 15px; line-height: 1; flex: none; }
.notice-sum {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-tog {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  padding: 1px 4px;
  transition: color .2s var(--ease);
}
.notice-tog::after { content: ' ▾'; }
.notice[open] .notice-tog::after { content: ' ▴'; }
.notice[open] .notice-bar { border-bottom: 1px solid var(--line); }
.notice[open] .notice-tog { color: var(--primary); }

/* 展开区：比管理端预览更紧凑，字号行高都收一档 */
.notice-body {
  border: 0;
  border-radius: 0;
  min-height: 0;
  padding: 12px 13px;
  font-size: 13.5px;
  line-height: 1.65;
  background: transparent;
  word-break: break-word;
}
.notice-body img {
  max-width: min(100%, 220px) !important;
  margin: 6px auto;
  border-radius: 8px;
}
.notice-body > :first-child { margin-top: 0; }
.notice-body > :last-child { margin-bottom: 0; }
.notice-body p, .notice-body div { margin: 0 0 6px; }
.notice-body h2 { font-size: 15px; margin: 10px 0 5px; }
.notice-body h3 { font-size: 14px; margin: 9px 0 4px; }
.notice-body ul, .notice-body ol { margin: 4px 0 6px; padding-left: 22px; }
.notice-foot {
  padding: 6px 13px 9px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
@media (max-width: 640px) {
  .notice-bar { padding: 9px 11px; gap: 7px; }
  .notice-sum { font-size: 13px; }
  .notice-body { padding: 11px; font-size: 13px; }
}

/* ---------- 收款码灯箱：点击缩略图就地放大，遮罩/×/Esc 关闭 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: rgba(9, 9, 11, .72);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox-img {
  max-width: min(92vw, 520px);
  max-height: 76vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  cursor: zoom-out;
  animation: lbIn .2s var(--ease);
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox-cap {
  font-size: 13.5px;
  color: #fff;
  opacity: .92;
  text-align: center;
}
.lightbox-close {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 10001;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  cursor: pointer;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.lightbox-close:hover { background: rgba(255, 255, 255, .26); transform: rotate(90deg); }
.lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .lightbox-img { animation: none; }
  .lightbox-close { transition: none; }
}
@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox-img { max-width: 92vw; max-height: 70vh; }
}

/* ---------- 查单对账：状态快捷标签（带条数，点一下即筛选） ---------- */
.st-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 14px;
}
.st-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 1.6;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.st-tab b {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.st-tab:hover { border-color: var(--line-2); background: var(--soft); color: var(--text); transform: translateY(-1px); }
.st-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--card);
}
.st-tab.active b { color: var(--card); opacity: .75; }
/* 状态色点：一眼分辨 */
.st-tab::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-2);
  flex: none;
}
.st-tab.st-pending::before { background: #94a3b8; }
.st-tab.st-instock::before  { background: #3b82f6; }
.st-tab.st-settling::before { background: #f59e0b; }
.st-tab.st-settled::before  { background: #16a34a; }
.st-tab.active::before { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
/* 安全日志页复用的两个状态点 */
.st-tab.st-fail::before    { background: #e11d48; }

/* 右上角的状态标签组：嵌在 list-head 的 head-acts 里，去掉外边距、贴右排 */
.st-tabs.head-tabs { margin: 0; justify-content: flex-end; }

/* 原标签位置换成的汇总条：报单人（姓名+手机号）+ 待结算金额（自动计算） */
.st-owner-bar { align-items: center; }
.st-tab.st-owner,
.st-tab.st-sum { cursor: default; }
.st-tab.st-owner::before,
.st-tab.st-sum::before { display: none; }   /* 非状态胶囊，不要色点 */
.st-owner .owner-name { color: var(--text); font-size: 13.5px; font-family: inherit; }
.st-owner .mono { font-size: 12px; color: var(--muted); font-style: normal; }
.st-sum .sum-val { color: #e11d48; font-size: 13px; }
.st-sum i { font-style: normal; color: var(--muted); }
@media (max-width: 640px) {
  .st-tabs.head-tabs { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .st-tabs { gap: 5px; margin: 10px 0 12px; }
  .st-tab { font-size: 12.5px; padding: 4px 9px; }
}

/* ---------- 安全日志 ---------- */
.table-logs { min-width: 880px; }
/* IP 数字段不能被打竖排：.table td 的 word-break:break-word 在窄屏会覆盖 nowrap */
.table-logs td.mono, .table-logs td.ev-tag, .table-logs td.res-tag { white-space: nowrap; }
.table-logs td.log-reason { white-space: normal; }
/* 失败行淡红底，一眼扫到异常 */
.table-logs tbody tr.row-fail { background: #fff7f8; }
.table-logs tbody tr.row-fail:hover { background: #ffeef1; }
.table-logs td.log-reason { font-size: 13px; max-width: 220px; }

/* 事件类型标签 */
.ev-tag {
  display: inline-block;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text-2);
  white-space: nowrap;
}
.ev-tag.ev-login    { background: #eff6ff; color: #1d4ed8; }
.ev-tag.ev-logout   { background: #f4f4f5; color: #52525b; }
.ev-tag.ev-register { background: #ecfdf5; color: #047857; }
.ev-tag.ev-forgot   { background: #fffbeb; color: #b45309; }

/* 成功 / 失败结果标签 */
.res-tag {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.6;
  padding: 1px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.res-ok   { background: #ecfdf5; color: #059669; }
.res-fail { background: #fff1f2; color: #e11d48; }

/* 可疑 IP 风险等级 */
.risk-tag {
  display: inline-block;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 1px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.risk-low  { background: #f4f4f5; color: #71717a; }
.risk-mid  { background: #fffbeb; color: #b45309; }
.risk-high { background: #fff1f2; color: #e11d48; font-weight: 600; }

/* 失败数异常时统计卡转红 */
.tile-danger {
  background-image: linear-gradient(135deg, #f43f5e, #f97316);
  border-color: transparent;
  color: #fff;
}
.tile-danger .tile-num,
.tile-danger .tile-label,
.tile-danger .tile-sub { color: #fff; }
.tile-danger .tile-sub { opacity: .9; }
.tile-danger:hover { box-shadow: 0 16px 40px -14px rgba(244, 63, 94, .6); }

/* 安全日志统计：一行四张等宽等高卡（不再用 2×2 大小卡拼，避免孤卡留白） */
.bento-row { grid-auto-rows: 1fr; }
.bento-row .tile { min-height: 128px; }
.bento-row .tile-head .tile-sub { text-align: right; }
.bento-row .tile-num { font-size: 34px; }
/* 查单对账统计行：卡片数随权限在 3～5 张间浮动（今日已结算 / 注册用户按权限显示），
   列数按容器宽度自适应，避免最后一张卡孤零零占一行 */
.bento-row.bento-fit { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
/* 今日已结算：浅绿底 + 深绿数字，和蓝、绿两张主卡区分开，一眼看出是「已到账」那一栏 */
.bento-row.bento-fit .tile.tile-settled { background-color: #ecfdf5; border-color: rgba(5, 150, 105, .3); }
.bento-row.bento-fit .tile.tile-settled .tile-num { color: #047857; }
.bento-row.bento-fit .tile.tile-settled:hover .tile-ico { background: #d1fae5; }
/* 数字状态色：成功偏绿、失败偏红（tile-danger 卡内保持白字由上面的规则接管） */
.tile .num-ok { color: #059669; }
.tile .num-bad { color: #e11d48; }

/* 结算行情：宽屏下窄表列被均分、空洞大——短内容列定宽，余量集中给文字列 */
.table-cats   th:nth-child(1) { width: 56px; }
.table-cats   th:nth-child(3) { width: 240px; }
.table-cats   th:nth-child(4) { width: 110px; }
/* 价格记录只显示当天，没有「日期」列：型号 / 价格 / 录入时间 / 操作 */
.table-prices th:nth-child(1) { width: auto; }
.table-prices th:nth-child(2) { width: 150px; }
.table-prices th:nth-child(3) { width: 240px; }
.table-prices th:nth-child(4) { width: 110px; }
.table-alias  th:nth-child(3) { width: 100px; }
.table-alias  th:nth-child(4) { width: 110px; }
.table-miss   th:nth-child(2) { width: 130px; }
.table-miss   th:nth-child(3) { width: 170px; }
@media (max-width: 860px) {
  .table-cats th, .table-alias th, .table-miss th { width: auto; }
  /* 价格表只剩 4 列、内容都短，最小宽相应收窄 */
  .table-prices { min-width: 620px; }
}

/* 「今天还没录行情」提示条：一行文字 + 右侧一个补齐按钮，窄屏自动换行 */
.carry-note {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.carry-note form { margin: 0; }
.carry-note b { font-weight: 700; }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 0 2px;
  flex-wrap: wrap;
}
.pager-btn {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  font-size: 13.5px;
  text-decoration: none;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.pager-btn:hover { background: var(--soft); color: var(--text); transform: translateY(-1px); }
.pager-info { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 页码数字：与 .pager-btn 同一视觉语言，当前页用实心高亮 */
.pager-num {
  display: inline-block;
  min-width: 32px;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  font-size: 13.5px;
  text-align: center;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.pager-num:hover { background: var(--soft); color: var(--text); }
.pager-num.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}
.pager-dots { color: var(--muted); font-size: 13px; letter-spacing: 1px; }

/* 双形态分页：桌面显示完整页码（.pager-desktop），窄屏换成大按钮（.pager-simple）。
   手机上「1 2 3 … 12」每个数字只有 32px 宽，挨在一起极易点错；
   窄屏只留「上一页 / 第 x/y 页 / 下一页」，按钮做高到 40px，一指一个准。
   两段都是服务端渲染的纯链接，禁用的那侧用 aria-disabled + 不输出 href。 */
.pager-simple {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.pager-big {
  flex: 1 1 auto;
  text-align: center;
  min-height: 40px;
  line-height: 28px;
  padding: 5px 10px;
  font-size: 14px;
}
.pager-big.disabled {
  opacity: .42;
  pointer-events: none;   /* 到头的方向：看着灰、点不动，但位置还在，不会让整排按钮左右跳 */
}
.pager-info-mid {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .pager-desktop { display: none; }
  .pager-simple { display: flex; }
  .pager-claim .pager-info { width: 100%; text-align: center; margin: 0 0 2px; }
}

@media (max-width: 720px) {
  /* 认领中心的搜索区：输入框整行、按钮放大到 40px 高（原来 30 出头，单手容易点空） */
  .page-claim .list-search { gap: 8px; }
  .page-claim .list-search-box { flex: 1 1 100%; height: 42px; }
  .page-claim .list-search-input { font-size: 16px; }   /* ≥16px：iOS Safari 才不会聚焦时自动放大整页 */
  .page-claim .list-search-btn {
    flex: 1 1 100%;
    min-height: 42px;
    font-size: 15px;
  }
  /* 搜索清除按钮：默认 22px 太小，撑到 30px 且离输入文字远一点 */
  .page-claim .list-search-clear { min-width: 30px; height: 30px; line-height: 30px; font-size: 15px; }

  /* 卡头：标题和计数挤在一行时，小屏给计数让出整行，免得标题被压成两行 */
  .page-claim .list-head { flex-wrap: wrap; gap: 4px 10px; }
  .page-claim .claim-sum { font-size: 12.5px; }

  /* 表格容器的横向内边距收一点，把省下的宽度全留给单号 */
  .page-claim .table-wrap { margin: 0; }
}
/* 每页条数：贴在分页条右端（移动端换行后居中） */
.pager-per { display: inline-flex; align-items: center; margin-left: 6px; }
.pager-per-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.pager-per .input-mini { width: auto; min-width: 68px; padding: 4px 6px; }

/* ============================================================
   扫码入库（管理后台）
   设计要点：输入框要足够大、反馈要足够显眼 —— 仓库环境里
   操作员是「扫一下瞄一眼」的节奏，不能靠仔细阅读小字
   ============================================================ */

/* 补一个「警告」态提示条（重复扫描用），补齐 ok / err 之外的一档 */
.alert-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }

.scan-tools { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 扫码输入区 ---------- */
.scan-form { display: flex; gap: 10px; align-items: stretch; margin: 4px 0 12px; }
.scan-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;            /* flex 子项默认 min-width:auto，会被长 placeholder 撑破 */
  display: flex;
  align-items: center;
}
.scan-ico {
  position: absolute;
  left: 16px;
  font-size: 20px;
  color: var(--muted);
  pointer-events: none;
  line-height: 1;
}
.scan-input {
  width: 100%;
  height: 62px;
  padding: 0 16px 0 48px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line-2);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
/* 占位符要用中文字体栈，不能 inherit（会继承输入框的等宽字体，中文会变成宋体感） */
.scan-input::placeholder {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}
.scan-input:focus { border-color: var(--focus); box-shadow: 0 0 0 4px var(--ring); }
/* 焦点跑丢时的提醒：点击即回到输入框 */
.scan-hint-focus {
  position: absolute;
  right: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  animation: scanPulse 1.6s ease-in-out infinite;
}
@keyframes scanPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.scan-btn {
  flex: 0 0 auto;
  height: 62px;
  padding: 0 26px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* ---------- 结果反馈条：三态一眼可辨 ---------- */
.scan-fb {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: background-color .18s var(--ease), border-color .18s var(--ease);
}
.scan-fb-ico {
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 700;
  border-radius: 50%;
  background: var(--soft);
  color: var(--text-2);
}
.scan-fb-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.scan-fb-title { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.3; }
.scan-fb-sub { font-size: 13.5px; color: var(--text-2); line-height: 1.55; word-break: break-all; }
.scan-fb-sub b { font-weight: 700; color: var(--text); }
.scan-sug { color: #b45309; }

.scan-fb-idle .scan-fb-ico { color: var(--muted); }
.scan-fb-ok   { background: #ecfdf5; border-color: #a7f3d0; }
.scan-fb-ok   .scan-fb-ico { background: #d1fae5; color: var(--ok); }
.scan-fb-ok   .scan-fb-title { color: #047857; }
.scan-fb-dup  { background: #fffbeb; border-color: #fde68a; }
.scan-fb-dup  .scan-fb-ico { background: #fef3c7; color: #b45309; }
.scan-fb-dup  .scan-fb-title { color: #b45309; }
/* 子件条码待确认：跟「重复扫描」一样用琥珀色，但意思不同 —— 这是等操作员点头，
   不是出错，所以标题用主色，别让人以为扫坏了 */
.scan-fb-ask  { background: #fffbeb; border-color: #fcd34d; }
.scan-fb-ask  .scan-fb-ico { background: #fef3c7; color: #b45309; }
.scan-fb-ask  .scan-fb-title { color: var(--text); }
/* 反馈卡片里的「是不是这件」两个按钮：单独一行铺开，别跟前面的文字挤在一起 */
.sub-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.scan-fb-miss,
.scan-fb-bad  { background: #fff1f2; border-color: #fecdd3; }
.scan-fb-miss .scan-fb-ico,
.scan-fb-bad  .scan-fb-ico { background: #ffe4e6; color: var(--danger); }
.scan-fb-miss .scan-fb-title,
.scan-fb-bad  .scan-fb-title { color: var(--danger); }

/* ---------- 摄像头（渐进增强，浏览器支持才出现） ---------- */
/* 取景器：画面比例必须跟摄像头原始画面一致（用 height:auto），
   千万别用 aspect-ratio + object-fit:cover —— 那样 16:9 的流会被裁掉左右两边，
   预览里瞅着对准了、实际解码时那块根本没进画面，典型的「看着有就是不识别」 */
.scan-cam { margin-top: 12px; text-align: center; }
.cam-stage {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 480px;
  line-height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}
.cam-stage video { display: block; width: 100%; height: auto; }
/* 取景区：框外压暗，让操作员明确知道「该往哪儿放」 */
.cam-frame {
  position: absolute;
  left: 13%; top: 13%;
  width: 74%; height: 74%;
  border: 2px dashed rgba(255, 255, 255, .8);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .3);
  pointer-events: none;
}
/* 扫描线：让操作员看到「系统确实在扫」，而不是干瞪眼 */
.cam-line {
  position: absolute;
  left: 13%; width: 74%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, .95), transparent);
  animation: camSweep 1.9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes camSweep {
  0%, 100% { top: 14%; }
  50%      { top: 85%; }
}
.scan-cam-tip { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.cam-diag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
  word-break: break-all;
}
.cam-quality {
  display: inline-block;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  margin-top: 8px;
}
.cam-acts {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
@media (prefers-reduced-motion: reduce) { .cam-line { animation: none; top: 50%; } }

/* ---------- 扫码记录：筛选 ---------- */
.scan-head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scan-head-tools .range-switch { margin-bottom: 0; }

.scan-filter {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 8px 0 12px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.scan-filter:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.scan-filter-ico { font-size: 13px; opacity: .55; margin-right: 6px; line-height: 1; }
.scan-filter-input {
  flex: 1 1 auto;
  width: 190px;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
}
.scan-filter-input::placeholder { color: var(--muted); font-size: 13px; }
.scan-filter-clear {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--soft);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.scan-filter-clear:hover { background: var(--line-2); color: var(--text); }
/* display:flex 会盖掉 hidden 属性的浏览器默认隐藏，必须显式声明 */
.scan-filter-clear[hidden] { display: none; }

.scan-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #1d4ed8;
  line-height: 1.5;
}
.scan-filter-bar b { font-weight: 700; }
.scan-filter-bar[hidden] { display: none; }

.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--focus);
  font-family: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); }

/* ---------- 扫码记录表 ---------- */
.table-scan { width: 100%; min-width: 0; }
/* 单号列：正常单号不折行；粘贴进来的超长串省略号截断，别把表格撑出横向滚动 */
.table-scan td.cell-no {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  padding: 1px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.scan-tag-ok   { background: #d1fae5; color: #047857; }
.scan-tag-dup  { background: #fef3c7; color: #b45309; }
.scan-tag-miss { background: #ffe4e6; color: var(--danger); }
.scan-tag-undo { background: var(--soft); color: var(--text-2); }

/* 状态小胶囊（补 .st-tab 之外的可内联使用版本） */
.st-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  padding: 1px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--soft);
  color: var(--text-2);
}
.st-tag.st-pending  { background: #f1f5f9; color: #475569; }
.st-tag.st-instock  { background: #dbeafe; color: #1d4ed8; }
.st-tag.st-settling { background: #fef3c7; color: #b45309; }
.st-tag.st-settled  { background: #d1fae5; color: #047857; }

/* 新扫进来的行闪一下，方便确认「刚才那条进来了」 */
.scan-row-new { animation: scanRowIn .9s var(--ease); }
@keyframes scanRowIn {
  0%   { background: rgba(59, 130, 246, .16); }
  100% { background: transparent; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .scan-form { gap: 8px; }
  .scan-input { height: 56px; font-size: 18px; padding: 0 12px 0 42px; }
  .scan-input::placeholder { font-size: 13.5px; }
  .scan-ico { left: 13px; font-size: 17px; }
  .scan-btn { height: 56px; padding: 0 18px; font-size: 15px; }
  .scan-fb { padding: 12px 14px; gap: 11px; }
  .scan-fb-ico { width: 34px; height: 34px; font-size: 18px; }
  .scan-fb-title { font-size: 15.5px; }
  .scan-fb-sub { font-size: 12.5px; }
  .scan-hint-focus { right: 8px; font-size: 11px; }
  /* 筛选：窄屏下输入框独占一行，时间范围按钮另起一行，别挤成一坨 */
  .scan-head-tools { width: 100%; }
  .scan-filter { flex: 1 1 100%; }
  .scan-filter-input { width: 100%; }
  .scan-filter-bar { font-size: 12.5px; padding: 7px 10px; }
  /* 窄屏下表格横向滚动，但列不许折成竖排 */
  .scope-admin .table-scan { min-width: 720px !important; }
  .scope-admin .table-scan td.mono,
  .scope-admin .table-scan td.nowrap,
  .scope-admin .table-scan td .scan-tag,
  .scope-admin .table-scan td .st-tag { white-space: nowrap; }
}

/* ============================================================
   查单对账页 · 扫描枪查单小窗
   复用扫码入库页的 .scan-form / .scan-input / .scan-fb 三态反馈，
   这里只补「结果里的操作按钮 + 候选单号」两小块
   ============================================================ */
.qb-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.qb-ask { font-size: 14px; font-weight: 700; color: #b45309; }
/* 未匹配时的候选单号：长得像标签，点一下就改用这个号再查一次 */
.qb-sug {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  background: #fff;
  border: 1px dashed var(--line-2);
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
}
.qb-sug:hover { border-color: var(--focus); color: var(--focus); }
/* 结果标题里的状态徽章：跟着标题字号走，别缩成小字 */
.scan-fb-title .st-tag { font-size: 12.5px; vertical-align: 2px; margin-left: 2px; }

@media (max-width: 640px) {
  .qb-acts .btn { flex: 1 1 auto; }
  .qb-ask { flex: 1 1 100%; }
}

/* ============================================================
   结算时间 + 备注回传客户
   结算时间跟着状态走（状态列下方一行绿字）；
   备注分「报单人备注 / 管理员回传备注 / 编辑区」三层，一眼分清谁能看到
   ============================================================ */
.cell-status { white-space: nowrap; }
.cell-settled { margin-top: 5px; font-size: 12px; line-height: 1.4; }
.cell-settled .st-time {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 5px;
  padding: 1px 6px;
}

/* 封账标记：封了账的订单内容一律冻结（超管也不例外），灰锁统一表示「不能改」 */
.lock-tag {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}
/* 「🔒 封账」= 把账锁死，用了冷色（石板蓝）—— 点下去是个有分量的动作，别跟普通保存一个样 */
.seal-btn { color: #334155; border-color: #cbd5e1; background: #f8fafc; }
.seal-btn:hover { color: #0f172a; border-color: #94a3b8; background: #e2e8f0; }
/* 「🔓 解封」= 改已封账单的唯一出口：琥珀色，跟别的按钮区分开 */
.unseal-btn { color: #b45309; border-color: #fed7aa; background: #fffbeb; }
.unseal-btn:hover { color: #92400e; border-color: #fdba74; background: #fef3c7; }
/* 兼容旧类名：万一有页面还写着 .unsettle-btn，不至于掉样式 */
.unsettle-btn { color: #b45309; border-color: #fed7aa; background: #fffbeb; }
.unsettle-btn:hover { color: #92400e; border-color: #fdba74; background: #fef3c7; }

/* ---------- 后台备注列 ---------- */
.cell-remark { max-width: 320px; min-width: 170px; font-size: 13px; }
.rmk-src,
.rmk-pub,
.rmk-in {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.5;
  margin-bottom: 4px;
  word-break: break-word;
}
.rmk-k {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--text-2);
}
.rmk-k-pub { background: #dbeafe; color: #1d4ed8; }
/* 内部备注：没勾「回传客户」的管理员备注，只有后台看得到 —— 琥珀色区分 */
.rmk-k-in { background: #fef3c7; color: #b45309; }
.rmk-v { color: var(--text-2); }
.rmk-pub .rmk-v { color: var(--text); }
.rmk-in .rmk-v { color: var(--text); }
.rmk-in { border-left: 2px solid #fde68a; padding-left: 7px; }
.rmk-at {
  flex: none;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.rmk-edit { margin-top: 2px; }
.rmk-edit summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rmk-edit summary::-webkit-details-marker { display: none; }
.rmk-edit summary:hover { color: var(--focus); }
.rmk-ta { width: 100%; margin-top: 6px; font-size: 13px; padding: 7px 9px; min-height: 52px; line-height: 1.5; }
/* 快捷扣减的样式统一放在文件末尾（要压过后台 .input / 卡片模式那一串覆盖，得靠后面的高优先级规则） */
.rmk-chk {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
}

/* ---------- 客户侧（报单页）---------- */
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
/* ---------- 报单备注（我的备注 / 客服回传）----------
   三处用户端列表（批量报单 / 报单 / 我的账单）共用：
   两条备注各占一块浅色圆角底，靠左上角的文字标签 + 配色区分是谁写的
   —— 我的备注 = 琥珀，客服备注 = 蓝。
   标签独占一行（flex-direction:column），窄列里也不会跟正文挤成竖排。 */
.rk-box {
  margin-top: 6px;
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12.5px; line-height: 1.6;
}
.rk {
  display: flex; flex-direction: column; gap: 2px;
  padding: 5px 9px 6px;
  border-radius: 8px;
}
.rk-mine { background: #fffbeb; }
.rk-cs   { background: #f1f7ff; }
.rk-tag {
  align-self: flex-start;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 700; line-height: 1.75;
  letter-spacing: .02em;
  white-space: nowrap;
}
.rk-mine .rk-tag { background: #fde68a; color: #92400e; }
.rk-cs   .rk-tag { background: #bfdbfe; color: #1d4ed8; }
.rk-txt { min-width: 0; word-break: break-word; white-space: pre-wrap; color: var(--text); }
.rk-at {
  font-style: normal; font-size: 11px; color: var(--muted); font-family: var(--mono);
  line-height: 1.4;
}
.cell-times { white-space: nowrap; font-size: 12.5px; line-height: 1.5; }
.t-settled { color: #047857; font-weight: 600; }
tr.tr-has-remark > td { background: #fbfcfe; }

/* 单号备注入口（我的账单「内容 / 备注」格里）：
   跟着原文和备注往下排，做成小号幽灵按钮，不抢原文和金额的视觉权重。
   加 inline-block 是为了窄屏卡片模式下不跟着格子拉伸整行。 */
.memo-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- 后台权限设置（admin/user_perm.php） ---------- */
.role-tag-staff {
  background: #eef2ff;
  color: #4338ca;
}
/* 财务：比受限账号多一条「封账 / 解封」，用琥珀底把它标出来 */
.role-tag-fin {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.perm-form .sub-title { margin: 22px 0 8px; }
.perm-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.perm-presets-k { font-size: 13px; color: var(--muted); }
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.perm-grid-off { opacity: .5; }
/* 权限页①区的板块小标题：横跨整行，把权限项分成「单据/仓库」「客户/内容」「结算/系统」几摊 */
.pg-group-title {
  grid-column: 1 / -1;
  margin: 6px 0 -2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
}
.pg-group-title:first-child { margin-top: 0; }
.perm-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text);
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.perm-item:hover { border-color: var(--focus); background: #fbfdff; }
.perm-item input[type="checkbox"] { width: 16px; height: 16px; flex: none; accent-color: #3b82f6; cursor: pointer; }
.perm-item input:disabled { cursor: not-allowed; }
.perm-item input:checked + span { font-weight: 600; }
.perm-item.perm-sub { margin-left: 16px; font-size: 13.5px; color: var(--text-2); }
.perm-item.perm-lock { background: var(--soft); color: var(--text-2); cursor: default; }
.perm-item.perm-lock:hover { border-color: var(--line-2); background: var(--soft); }
.perm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.perm-tip { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.perm-warn {
  margin: 12px 0 0;
  padding: 10px 13px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 13.5px;
  color: #b45309;
}
.perm-tags { display: flex; flex-wrap: wrap; gap: 5px; max-width: 520px; }
.perm-tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  white-space: nowrap;
}
.perm-tag-col { background: #f5f3ff; color: #6d28d9; }
.perm-tag-st { background: #ecfdf5; color: #047857; }
.perm-tag-fin { background: #fffbeb; color: #b45309; }
.perm-none { font-size: 13px; color: #b45309; }
.table-staff { min-width: 820px; }
.table-staff td { vertical-align: middle; }

/* 只看不改：型号/数量的纯文本展示 */
.ro-models { font-size: 13.5px; color: var(--text-2); line-height: 1.7; word-break: break-word; }

/* ---------- 查单对账：自定义日期区间 ---------- */
/* 选「自定义日期」时才出现，跟「当天/近一周」这类预设互斥（JS 控制 hidden） */
.date-range { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.date-range[hidden] { display: none; }
.date-input { width: 150px; flex: 0 0 auto; font-size: 14px; padding: 9px 10px; }
.date-sep { font-size: 13px; color: var(--text-2); flex: 0 0 auto; }
@media (max-width: 640px) {
  /* 窄屏：整行独占，两个日期框平分宽度，避免溢出屏幕 */
  .date-range { flex: 1 1 100%; }
  .date-input { flex: 1 1 0; width: auto; min-width: 0; }
}

/* ============================================================
   物流查询：查单页卡片头部按钮 + 单号列按钮 + 轨迹弹窗
   ============================================================ */
.head-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 单号不再单独占一行时，按钮跟着单号一起换行不撑破单元格 */
.tk-cell { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-btn {
  font-size: 12px;
  padding: 3px 10px;
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
}

.tk-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 9, 11, .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.tk-mask[hidden] { display: none; }

.tk-panel {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  max-height: min(80vh, 720px);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  overflow: hidden;
  animation: tkIn .18s var(--ease);
}
@keyframes tkIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .tk-panel { animation: none; } }

.tk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.tk-title { font-size: 16.5px; font-weight: 600; color: var(--text); }
.tk-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  font-size: 21px;
  line-height: 1;
  color: var(--text-2);
  background: var(--soft);
  cursor: pointer;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.tk-close:hover { background: var(--line-2); transform: rotate(90deg); }

.tk-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tk-form .tk-input { flex: 1 1 200px; width: auto; min-width: 0; }
.tk-form .tk-input-sm { flex: 0 0 108px; width: 108px; }

/* 查询方式切换（报单人端：原有查询 / 快递100） */
.tk-methods {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px 0;
}
.tk-method {
  padding: 5px 15px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.6;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.tk-method:hover { background: var(--soft); color: var(--text); }
.tk-method.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* 快递100 模式：手机尾号与「实时查询」跟那个页面无关，直接收起来 */
.tk-form-kd .tk-input-sm,
.tk-form-kd #tkRefresh { display: none; }

/* 内嵌第三方页面时，面板要有个确定高度，iframe 才撑得开 */
.tk-panel.tk-mode-frame { height: min(80vh, 720px); }
.tk-body.tk-body-frame {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;   /* 滚动交给 iframe 内部，免得出现两条滚动条 */
}
.tk-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #ffffff;
}
.tk-frame-tip {
  flex: none;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.tk-frame-tip a { color: var(--text-2); text-decoration: underline; }
.tk-body-frame .tk-empty { padding: 16px 18px; }

.tk-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; }
.tk-loading, .tk-empty { font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.tk-err {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
}
.tk-err p { font-size: 13.5px; font-weight: 600; color: #dc2626; line-height: 1.6; }

.tk-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--line-2);
}
.tk-carrier { font-size: 15px; font-weight: 600; color: var(--text); }
.tk-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.tk-badge.st-done { background: #ecfdf5; color: #047857; }
.tk-badge.st-move { background: #eff6ff; color: #1d4ed8; }
.tk-badge.st-wait { background: var(--soft); color: var(--text-2); }
.tk-badge.st-bad  { background: #fef2f2; color: #dc2626; }
.tk-cnt { font-size: 12.5px; color: var(--muted); }
.tk-cache { font-size: 12px; color: #b45309; background: #fffbeb; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.tk-meta .tk-no { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); margin-left: auto; word-break: break-all; }

.tk-list { list-style: none; display: flex; flex-direction: column; }
.tk-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 18px 0;
}
/* 竖线：最后一条不画，避免悬空 */
.tk-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--line-2);
}
.tk-item:last-child { padding-bottom: 2px; }
.tk-item:last-child::before { display: none; }
.tk-dot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--line-2);
}
/* 最新一条高亮：一眼看到「现在到哪了」 */
.tk-item-top .tk-dot { border-color: #2563eb; background: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.tk-right { flex: 1 1 auto; min-width: 0; }
.tk-time { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.tk-ctx { font-size: 14px; color: var(--text-2); line-height: 1.6; word-break: break-word; }
.tk-item-top .tk-ctx { font-weight: 600; color: var(--text); }

@media (max-width: 640px) {
  /* 手机端改成「底部抽屉」式：全宽贴底、上圆角，几乎占满整屏 */
  .tk-mask { padding: 0; align-items: flex-end; }
  .tk-panel { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .tk-panel.tk-mode-frame { height: 92vh; max-height: 92vh; }
  .tk-head { padding: 12px 14px; }
  .tk-methods { gap: 6px; padding: 10px 12px 0; }
  .tk-method { padding: 4px 13px; font-size: 12.5px; }
  .tk-form {
    flex-wrap: nowrap;          /* 单号/尾号/按钮一行放下，不再各占一行 */
    gap: 6px;
    padding: 10px 12px;
  }
  .tk-form .tk-input { flex: 1 1 auto; min-width: 0; }
  .tk-form .tk-input-sm { flex: 0 0 86px; width: 86px; }
  .tk-form .btn { flex: none; padding-left: 14px; padding-right: 14px; }
  .tk-body { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
  .tk-meta { gap: 6px; }
  .tk-meta .tk-no { margin-left: 0; }
  .tk-time { font-size: 11.5px; }
  .tk-ctx { font-size: 13.5px; }
}

/* ============================================================
   物流自动抓取：定时任务地址框 + 执行记录表
   ============================================================ */
.sep { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
.hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.ok-text { color: #047857; font-weight: 600; }

.tk-url-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-url {
  flex: 1 1 340px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--soft);
}

.table-jobs { font-size: 13px; }
.table-jobs th, .table-jobs td { white-space: nowrap; }
.table-jobs td:last-child { white-space: normal; word-break: break-word; }

@media (max-width: 640px) {
  .tk-url-box .btn { flex: 1 1 100%; }
}

/* 物流弹窗里的数据来源 / 新鲜度标记 */
.tk-live { background: #eff6ff; color: #1d4ed8; }
.tk-stale { font-size: 12px; color: #b45309; background: #fffbeb; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }

/* 订单列表单号下方的物流摘要条：整条浅色圆角底，状态点着色，比裸文字更整体 */
.tk-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  max-width: 520px;
  padding: 5px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  background: var(--soft);
  color: var(--text-2);
}
.tk-mini-in_transit, .tk-mini-picked_up, .tk-mini-out_for_delivery { background: #eff6ff; color: #1e40af; }
.tk-mini-delivered { background: #ecfdf5; color: #065f46; }
.tk-mini-exception { background: #fef2f2; color: #b91c1c; }
.tk-mini-st { flex: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tk-mini-st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tk-mini-in_transit .tk-mini-st::before, .tk-mini-picked_up .tk-mini-st::before, .tk-mini-out_for_delivery .tk-mini-st::before { background: #3b82f6; }
.tk-mini-delivered .tk-mini-st::before { background: #10b981; }
.tk-mini-exception .tk-mini-st::before { background: #ef4444; }
.tk-mini-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .88; }
.tk-mini-time { flex: none; font-family: var(--mono); font-size: 11.5px; opacity: .6; white-space: nowrap; }
/* 受限账号（列被权限隐藏）时单号列空间充裕：摘要条占满可用宽度，长轨迹换行完整显示 */
.tk-roomy .tk-mini { max-width: 100%; }
.tk-roomy .tk-mini-txt { white-space: normal; }
.tk-roomy .tk-mini-time { margin-left: auto; }
@media (max-width: 640px) {
  .tk-mini { max-width: 100%; gap: 8px; }
  .tk-mini-time { display: none; }
}

/* 「正在抓取…」运行中提示（点完立即执行后出现，轮询结束自动消失） */
.tk-runstate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
  animation: tk-pulse 1.4s ease-in-out infinite;
}
@keyframes tk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ============================================================
   结构化报单页（user/report.php）
   单号 + 型号搜索下拉 + 多组「型号 / 数量 / 单位」
   ============================================================ */
.rp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.rp-head .label { margin-bottom: 7px; }
.rp-count {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rp-nos { min-height: 62px; }

.rp-items { display: flex; flex-direction: column; gap: 10px; }
.rp-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 116px 40px;
  grid-template-areas:
    "model qty unit del"
    "hint  hint hint hint";
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.rp-item .input { background: var(--card); font-size: 15px; padding: 9px 11px; }
.rp-model { grid-area: model; position: relative; min-width: 0; }
.rp-qty   { grid-area: qty; text-align: center; font-family: var(--mono); }
.rp-unit  { grid-area: unit; }
.rp-del {
  grid-area: del;
  width: 40px;
  padding: 6px 0;
  text-align: center;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
}
.rp-del:hover { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
.rp-hint { grid-area: hint; font-size: 13px; line-height: 1.6; color: var(--text-2); }
.rp-hint b { font-family: var(--mono); font-weight: 600; }
.rp-hint:empty { display: none; }

/* 三态：库里有 / 型号存疑 / 有错 */
.rp-item.rp-st-ok    { border-color: #a7f3d0; background: #f0fdf4; }
.rp-item.rp-st-ok .rp-hint    { color: #047857; }
.rp-item.rp-st-warn  { border-color: #fde68a; background: #fffbeb; }
.rp-item.rp-st-warn .rp-hint  { color: #b45309; }
.rp-item.rp-st-error { border-color: #fecaca; background: #fef2f2; }
.rp-item.rp-st-error .rp-hint { color: #dc2626; }
.rp-item.rp-st-error .rp-minput { border-color: #fca5a5; }

/* 型号搜索下拉（跟着型号输入框展开） */
.rp-drop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 268px;
  overflow-y: auto;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.rp-drop[hidden] { display: none; }
.rp-opt {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}
.rp-opt:hover, .rp-opt.active { background: var(--soft); }
.rp-oname { font-weight: 600; }
.rp-oalias { font-size: 12.5px; color: var(--muted); }
.rp-opt mark { background: #fef08a; color: inherit; border-radius: 4px; padding: 0 2px; }
.rp-opt-empty { padding: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }

.rp-add { margin-top: 10px; }

@media (max-width: 560px) {
  .rp-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .rp-item {
    grid-template-columns: minmax(0, 1fr) 92px 40px;
    grid-template-areas:
      "model model model"
      "qty   unit  del"
      "hint  hint  hint";
  }
  .rp-drop { max-height: 230px; }
}

/* ============================================================
   结算金额：后台手填 / 客户端展示
   规则「手填优先、行情做参考」——
   后台同时展示两个值（手填值 + 行情参考），客户端只展示最终生效值
   ============================================================ */

/* ---------- 后台：查单对账的金额列 ---------- */
.amt-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
}
.amt-line .amt { display: inline; }
.cell-amount .amt-manual { color: #b45309; }          /* 手填值：琥珀色，一眼区别于行情值 */

.amt-src {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.7;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}
.amt-src-manual { color: #b45309; border-color: #fcd34d; background: #fffbeb; }

.amt-input {
  display: block;
  width: 86px;
  margin-top: 4px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 4px 7px;
}
.amt-input::placeholder { font-family: inherit; font-size: 11.5px; }

.amt-ref,
.amt-at {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  max-width: 150px;
  white-space: normal;
  word-break: break-all;
}
.amt-ref { cursor: help; }
.amt-at { font-variant-numeric: tabular-nums; }
.amt-warn-soft { color: var(--muted); }

/* ---------- 备注扣减（货损等）：金额旁标出扣了多少、扣的什么 ---------- */
.amt-deduct {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid #fecdd3;
  background: #fef2f2;
  color: #dc2626;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.6;
  cursor: help;
  white-space: nowrap;
}
.amt-deduct i { font-family: inherit; font-style: normal; font-weight: 600; color: #b91c1c; opacity: .82; }

/* 已手填金额、备注里又有扣减项：只提示不自动扣，用中性色避免误以为已经扣了 */
.amt-deduct-hint {
  display: block;
  margin-top: 3px;
  max-width: 160px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px dashed #fcd34d;
  background: #fffbeb;
  color: #b45309;
  font-size: 11px;
  line-height: 1.45;
  cursor: help;
  white-space: normal;
}

/* 备注列里的小标记：这段备注被识别成扣减项了 */
.rmk-deduct {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid #fecdd3;
  background: #fef2f2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  cursor: help;
}
.rmk-deduct i { font-style: normal; font-family: var(--mono); }

/* ---------- 客户端：报单记录里的金额列 ---------- */
.cell-amount-u { white-space: nowrap; }
.u-amt {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  cursor: help;
}
.u-amt-manual { color: var(--ok); }                    /* 管理员手填的金额：绿色，和行情估算值区分开 */

/* 客户账单里：金额被备注扣减时的小字（「已扣 盒损 −6.00」，让用户知道钱为什么少了） */
.u-deduct {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.45;
  color: #dc2626;
  white-space: normal;
  max-width: 150px;
  cursor: help;
}

/* 用户端报单表格：列多（序号 / 报单时间 / 单号 / 内容 / 状态 / 入库·结算时间 / 金额 / 操作），
   给个下限宽度，窄屏靠横向滚动而不是把内容挤没。
   注意别超过桌面容器（.main 860 - 内边距 ≈ 780）放得下的量，否则宽屏也得横向滚动、
   最右边的「入库 / 结算时间」会被裁掉。 */
.table-orders-user { min-width: 700px; }
.table-orders-user th, .table-orders-user td { padding-left: 7px; padding-right: 7px; }
/* 报单时间：放得下就一行，挤了在日期和时间之间折行（单词内部不拆）。
   width 是给表格自动布局的期望值（≈ 完整「2026-10-12 22:44:25」一行），
   空间实在不够时其它列先缩，它最多折成两行 */
.cell-rep { white-space: normal; word-break: keep-all; overflow-wrap: normal; width: 138px; }

@media (max-width: 640px) {
  .amt-ref, .amt-at { max-width: 110px; }
  .amt-input { width: 76px; }
}

/* ============================================================
   公告信息框弹窗（user/index.php）
   进页自动弹一次（同一版公告读过不再弹），摘要条可随时点开重看
   ============================================================ */
button.notice-bar {
  width: 100%;
  font: inherit;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
button.notice-bar .notice-tog::after { content: ''; }

.nt-panel { width: min(560px, 100%); }
.nt-body {
  padding: 16px 18px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.75;
  word-break: break-word;
}
.nt-body img {
  max-width: min(100%, 260px) !important;
  margin: 6px auto;
  border-radius: 8px;
}
.nt-body > :first-child { margin-top: 0; }
.nt-body > :last-child { margin-bottom: 0; }
.nt-body p, .nt-body div { margin: 0 0 6px; }
.nt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

/* ============================================================
   报单 / 批量报单 → 「我的账单」入口（bill_shortcut_btn()）
   挂在卡片标题行右侧（.list-head 已经是 space-between + wrap）。
   做成绿色渐变胶囊而不是普通按钮：它是个「去另一个页面」的入口，
   配色跟账单页那两块金额瓷砖同源（深绿→青绿），一眼能连上「钱」；
   悬停上浮 + 箭头右移，点感明确。
   ============================================================ */
.bill-entry {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 9px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  background-image: linear-gradient(135deg, #047857, #0f766e);
  box-shadow: 0 8px 20px -14px rgba(4, 120, 87, .95), inset 0 0 0 1px rgba(6, 95, 70, .28);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
/* 和金额瓷砖同款柔光，纯渐变容易发闷 */
.bill-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(72px 46px at 90% 4%, rgba(255, 255, 255, .30), transparent 64%);
}
.bill-entry > * { position: relative; z-index: 1; }

.bill-entry .be-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  font-size: 15px;
  line-height: 1;
}
.bill-entry .be-txt { display: flex; flex-direction: column; line-height: 1.2; }
.bill-entry .be-txt b { font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.bill-entry .be-txt i { font-style: normal; font-size: 11px; opacity: .84; margin-top: 1px; }
.bill-entry .be-arrow {
  font-size: 15px;
  line-height: 1;
  opacity: .78;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}
.bill-entry:hover {
  transform: translateY(-1px);
  color: #fff;
  box-shadow: 0 14px 28px -14px rgba(4, 120, 87, .9), inset 0 0 0 1px rgba(6, 95, 70, .32);
}
.bill-entry:hover .be-arrow { transform: translateX(3px); opacity: 1; }
.bill-entry:active { transform: translateY(0); }

/* 窄屏：标题与入口各占一行，入口拉满宽度（≥44px 点击区），
   副标题吃掉剩余宽度把箭头顶到最右，整条都是可点区域。 */
@media (max-width: 720px) {
  .bill-entry {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    margin-top: 2px;
    padding: 9px 14px 9px 10px;
  }
  .bill-entry .be-txt { flex: 1 1 auto; min-width: 0; }
  .bill-entry .be-txt b { font-size: 14.5px; }
}

/* 从报单页跳过来时（profile.php?status=all#bill）账单区不要被吸顶导航压住。
   顶栏高度由 page_footer 的脚本实测后写进 --topbar-h（手机导航会换行，高度不固定），
   脚本没跑起来的极端情况退回 64px。 */
#bill { scroll-margin-top: calc(var(--topbar-h, 64px) + 14px); }

/* ============================================================
   我的账单：结算金额仪表盘（profile.php）
   今日结算金额 / 总金额 两块瓷砖
   ============================================================ */
/* 呼应全局 bento：两块瓷砖都是「彩色实底 + 白字」，靠 --accent / --accent-2 切换主色，
   装饰光斑 / 阴影 / 数值色全部由它们派生，所以加新口味只要再补一个 .bill-tile-* 类。
   配色是特意这么排的：
   · 今日结算金额 —— 深绿→深青：跟系统里 .tile-settled 的「已结算=绿」语义对齐；
   · 全部合计 —— 深蓝→深青：总量是中性口径，用蓝，与左边形成冷色递进（绿 → 蓝）。
   两块同属冷色但起点色相差得开，既统一又能一眼分开。
   端色都压得比常规调色板深一档，原因是白字 + 12px 小字必须压在渐变最浅的那端
   也满足 4.5:1；亮的青/绿（如 #10b981 / #06b6d4）白字只有 2.4~2.5:1，会糊。
   另外没用 --grad-c（绿→青）：它在金额场景里容易被读成涨跌色，且与左边撞色。 */
.bill-dash {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.bill-tile {
  --accent: #047857;                      /* 兜底主色 */
  --accent-2: #0f766e;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--tile-shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
/* 装饰光斑：给纯色底加一点空间感，不引第三方图片
   用 ::before + 两层 radial 画在内容下方（z-index:0 且内容 z-index:1），
   这样数值和文字不受影响，也不会因为 overflow:hidden 被裁一半。 */
.bill-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120px 90px at 88% 8%, rgba(255, 255, 255, .30), transparent 60%),
    radial-gradient(150px 110px at 6% 108%, rgba(255, 255, 255, .16), transparent 62%);
}
.bill-tile > * { position: relative; z-index: 1; }

/* 今日结算金额：深绿→青绿，跟 .tile-settled 同为「已结算」语义。
   选色不是凭感觉：白字要压在渐变最浅的那一端也算得过去，
   所以端色比「默认绿」压深了一档（不能直接拿亮绿 #10b981，白字只有 2.5:1）。 */
.bill-tile-today {
  --accent: #047857;
  --accent-2: #0f766e;
  --tile-shadow: 0 8px 24px -14px rgba(4, 120, 87, .62);
  --tile-shadow-hover: 0 14px 34px -14px rgba(4, 120, 87, .55);
}
/* 全部合计（筛选后标题会变成「筛选区间合计」，但配色不变）：
   深蓝→深青，跟左边的青绿形成冷色递进，两块一眼能分开。
   同样把端色压深，保证 12px 的小字在浅色端也读得清。 */
.bill-tile-sum {
  --accent: #1d4ed8;
  --accent-2: #0e7490;
  --tile-shadow: 0 8px 24px -14px rgba(29, 78, 216, .62);
  --tile-shadow-hover: 0 14px 34px -14px rgba(29, 78, 216, .55);
}
.bill-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--tile-shadow-hover, 0 14px 34px -14px rgba(24, 24, 27, .35));
}

.bill-tile .k {
  font-size: 13px;
  color: rgba(255, 255, 255, .92);
  letter-spacing: .01em;
}
.bill-tile .num {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .10);
  word-break: break-all;      /* 金额太长时不允许撑破瓷砖 */
}
.bill-tile .s {
  font-size: 12px;
  color: rgba(255, 255, 255, .88);
}

@media (max-width: 480px) {
  .bill-tile .num { font-size: 20px; }
  .nt-body { padding: 14px; }
  .nt-foot { padding: 11px 14px; }
}

/* 超窄屏（≤360px）：两列会把金额挤成竖排，改成上下堆叠。
   同时把 .k / .s 收小一号，避免小字在深色底上显得糊。 */
@media (max-width: 360px) {
  .bill-dash { grid-template-columns: 1fr; gap: 10px; }
  .bill-tile { padding: 12px 14px; }
  .bill-tile .k { font-size: 12.5px; }
  .bill-tile .num { font-size: 22px; }
  .bill-tile .s { font-size: 11.5px; }
}

/* ============================================================
   结算行情 · 价格就地编辑（失焦 / 回车即存）
   ============================================================ */
.price-inp { width: 118px; font-family: var(--mono); font-weight: 700; }
.price-msg { font-size: 12.5px; }
.price-msg-ok { color: var(--ok); }
.price-msg-bad { color: var(--danger); }

/* 输入框保存反馈（行情价格 / 认领清单共用）：成功浅绿描边，失败红框 */
.inp-ok { border-color: var(--ok) !important; box-shadow: 0 0 0 3px rgba(5, 150, 105, .12) !important; }
.inp-bad { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(225, 29, 72, .12) !important; }

/* ============================================================
   查单对账 · 收款信息弹窗（外壳复用 .tk-mask / .tk-panel）
   ============================================================ */
.user-link.pay-open {
  background: none; border: 0; padding: 0; font: inherit;
  color: #2563eb; font-weight: 500; cursor: pointer; text-align: left;
}
.user-link.pay-open:hover { text-decoration: underline; }
.pay-panel { width: min(560px, 100%); }
.pay-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line);
}
.pay-foot-hint { font-size: 12.5px; color: var(--muted); }
.pay-foot-btns { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
/* 「标记已结算」：财务 / 管理员的收尾动作，用绿色跟旁边的按钮区分开 */
.btn-settle { background: #059669; border-color: #059669; color: #fff; }
.btn-settle:hover { background: #047857; border-color: #047857; color: #fff; }
.btn-settle[hidden] { display: none; }   /* display 会盖掉 hidden 属性的默认隐藏，得显式声明 */
.pay-loading { font-size: 14px; color: var(--muted); margin: 6px 0; }
/* 「导出待结算」走支付宝批量付款，用支付宝蓝跟旁边的导出按钮分开 */
.btn-ali { background: #1677ff; border-color: #1677ff; color: #fff; }
.btn-ali:hover { background: #0958d9; border-color: #0958d9; color: #fff; }
/* 「还有 N 人未填支付宝账号」：提醒导出会漏人，但不拦着 */
.pay-miss { font-size: 12.5px; color: #b45309; white-space: nowrap; }

/* ---- 打款核对（支付宝对账单上传核销） ---- */
.ac-up { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ac-file {
  display: flex; align-items: center; gap: 10px; flex: 1 1 320px; min-width: 0;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 14px; background: var(--soft); cursor: pointer;
}
.ac-file:hover { border-color: #1677ff; }
.ac-file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ac-file-btn {
  flex: 0 0 auto; font-size: 13px; padding: 6px 14px; border-radius: var(--radius-sm);
  background: #fff; border: 1px solid var(--line-2); color: var(--text);
}
.ac-file-txt {
  font-size: 13px; color: var(--muted); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ac-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
.ac-meta-i { font-size: 13px; }
.ac-meta-i i { font-style: normal; color: var(--muted); margin-right: 6px; }
.ac-meta-i b { font-weight: 700; }
.ac-stat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.ac-stat-i {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 12px 14px; background: #fff;
}
.ac-stat-i b { display: block; font-size: 22px; line-height: 1.2; }
.ac-stat-i i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.ac-stat-i.ok    { background: #f0fdf4; border-color: #bbf7d0; }
.ac-stat-i.ok b  { color: #15803d; }
.ac-stat-i.warn  { background: #fffbeb; border-color: #fde68a; }
.ac-stat-i.warn b{ color: #b45309; }
.ac-stat-i.muted { background: var(--soft); }
.ac-stat-i.bad   { background: #fef2f2; border-color: #fecaca; }
.ac-stat-i.bad b { color: #dc2626; }
.ac-h3 { font-size: 15px; margin: 20px 0 10px; font-weight: 700; }
.ac-h3 .tip { font-weight: 400; }
.ac-tip { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-table { width: 100%; }
.ac-table .ta-r { text-align: right; white-space: nowrap; }
.ac-table .ac-ck { width: 40px; text-align: center; }
.ac-table .ac-ck input { width: 16px; height: 16px; cursor: pointer; }
.ac-acct { word-break: break-all; }
.ac-money { color: #15803d; }
.ac-plus  { color: #b45309; }
.ac-minus { color: #dc2626; }
.ac-reason { font-size: 12.5px; color: var(--text-2); max-width: 320px; }
.ac-actions { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ac-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 720px) {
  .ac-stat { grid-template-columns: repeat(2, 1fr); }
  .ac-up { flex-direction: column; align-items: stretch; }
  .ac-file { flex: 1 1 auto; }
  .ac-actions .btn { width: 100%; }
}
.pay-zoom { margin-top: 12px; text-align: center; }
.pay-zoom img { max-width: 240px; max-height: 240px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); }
.pay-zoom-cap { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.qr-thumb-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.qr-thumb-btn img {
  width: 72px; height: 72px; object-fit: cover; display: block;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.qr-thumb-btn:hover img { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-md); }
.qr-thumb-btn span { font-size: 12px; color: var(--text-2); }

/* ============================================================
   认领中心（后台待认领清单 + 报单人端）
   ============================================================ */
.claim-sum { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.claim-sum b { font-family: var(--mono); font-size: 15px; color: var(--text); }

/* 列表搜索框（通用）：用户端认领中心 / 最近报单记录 / 最近报单 / 报单记录 共用
   GET 表单，回车或点「搜索」都行；≤720px 输入框占满一行、按钮换行 */
.list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.list-search-box {
  display: flex;
  align-items: center;
  flex: 0 1 320px;
  height: 38px;
  padding: 0 8px 0 12px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.list-search-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.list-search-ico { font-size: 13px; opacity: .55; margin-right: 6px; line-height: 1; }
.list-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.list-search-input::placeholder { color: var(--muted); font-size: 13.5px; }
.list-search-clear {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.list-search-clear:hover { background: var(--line-2); color: var(--text); }
.list-search-btn { flex: none; }
.list-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #1d4ed8;
  line-height: 1.5;
}
.list-search-bar b { font-weight: 700; }
.pager-claim { padding-top: 12px; }
@media (max-width: 720px) {
  .list-search-box { flex: 1 1 100%; }
  .list-search-btn { flex: 0 0 auto; }
}
/* 认领清单：单号 / 内容明细 / 登记时间 / 操作人 / 操作 */
.table-claim th:nth-child(3),
.table-claim th:nth-child(4) { width: 118px; }
.table-claim th:nth-child(5) { width: 210px; }
.claim-detail { font-size: 13.5px; line-height: 1.5; }
.claim-msg { font-size: 12.5px; margin-right: 6px; }
.claim-msg-ok { color: var(--ok); }
.claim-msg-bad { color: var(--danger); }
.claim-inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: 10px; }
.claim-done { margin-top: 12px; }
.claim-done summary { cursor: pointer; font-size: 14px; color: var(--text-2); padding: 6px 0; }
.scan-tag-claim { background: #ffedd5; color: #c2410c; }

/* 后台「内容明细」弹窗：一行一个型号 + 数量，可增可删 */
.cd-panel { width: min(560px, 100%); }
.cd-target {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px;
  display: flex; gap: 10px; align-items: baseline;
}
.cd-k { color: var(--text-2); flex: 0 0 58px; font-size: 14px; }
/* 弹窗单号后的复制按钮：容器是 baseline 对齐，按钮自己居中，别跟着文字基线飘 */
#cdNoCpy { display: inline-flex; align-items: center; align-self: center; }
.cd-head,
.cd-row { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; align-items: center; }
.cd-head { margin: 4px 0 6px; font-size: 12.5px; color: var(--text-2); }
.cd-row { margin-bottom: 8px; }
.cd-row .cd-model, .cd-row .cd-qty { width: 100%; }
.cd-del { padding: 4px 9px; line-height: 1; font-size: 15px; }
#cdRows { max-height: 46vh; overflow-y: auto; }
#cdAdd { margin-top: 2px; }
.cd-msg { font-size: 12.5px; margin-right: auto; }
.cd-msg-bad { color: var(--danger); }
.cd-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line);
}

/* 扫码入库 · 核对后入库弹窗：改动前后对比 + 提示 */
.ic-panel { width: min(560px, 100%); }
.ic-who { margin-left: auto; color: var(--text-2); font-size: 13px; }
#icRows { max-height: 40vh; overflow-y: auto; }
#icAdd { margin-top: 2px; }
.ic-stat {
  margin-top: 12px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); display: grid; gap: 6px;
}
/* display:grid 会盖掉 [hidden] 属性自带的 display:none（同类坑：tk-mask / btn-settle），
   不补这条的话，弹窗重开时对比条藏不住，上次编辑留的旧值会一直挂着 */
.ic-stat[hidden] { display: none; }
.ic-stat-line { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; min-width: 0; }
.ic-stat-line b { overflow-wrap: anywhere; }
.ic-k { color: var(--text-2); flex: 0 0 88px; font-size: 12.5px; }
.ic-warn { margin: 10px 0 0; font-size: 13px; color: #b45309; }
.ic-note { color: #047857; }
.scan-tag-skip { background: #e5e7eb; color: #4b5563; }
.scan-tag-sub  { background: #fef3c7; color: #b45309; }

/* 报单人端 · 认领中心页 */
.cl-no { letter-spacing: .06em; }
.table-claim-user th:nth-child(1) { width: 200px; }
.table-claim-user th:nth-child(3) { width: 170px; }
.table-claim-user th:nth-child(4) { width: 110px; }
.cl-panel { width: min(520px, 100%); }
.cl-panel form { display: flex; flex-direction: column; min-height: 0; }
.cl-target {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px;
}
.cl-target-row { display: flex; gap: 10px; font-size: 14px; padding: 3px 0; }
.cl-k { color: var(--text-2); flex: 0 0 84px; }
.cl-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line);
}

/* 报单人端 · 单号备注弹窗（自己的单号写备注） */
.memo-panel { width: min(520px, 100%); }
.memo-target {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px;
  display: flex; gap: 10px; align-items: baseline;
}
.memo-k { color: var(--text-2); flex: 0 0 58px; font-size: 14px; }
.memo-msg { font-size: 12.5px; margin-right: auto; }
.memo-msg-bad { color: var(--danger); }
.memo-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line);
}
/* 报单人端 · 记录列表（备注样式见上方 .rk-*） */
/* 操作列：两个按钮上下堆叠（桌面），省出横向空间给「报单时间」单行显示；
   窄屏卡片里由 720px 媒体查询改回横排占整行 */
.table-orders-user .cell-ops-u {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  white-space: nowrap;
}
.table-orders-user .cell-ops-u .btn { width: 100%; }
.table-orders-user .cell-ops-u .del-form { margin-left: 0; }
.table-orders-user .cell-ops-u .del-lock { margin-left: 0; align-self: center; }

/* 用户端「我的账单」· 未入库单的行内编辑区
   编辑区是表格里单独一个 <tr>（colspan 铺满），带 .tr-edit 且默认 hidden。
   用 td 包一层内边距、里层 .edit-form 做成一个小面板，视觉上跟上面那条单子分开。 */
.table-orders-user tr.tr-edit > td {
  background: var(--panel);
  padding: 10px 12px;
}
.table-orders-user .edit-form { display: flex; flex-direction: column; gap: 10px; }
.table-orders-user .edit-form .md-list { max-width: 420px; }
.table-orders-user .edit-form .md-row { gap: 8px; }
.table-orders-user .edit-form .md-row input[name="models[]"] { min-width: 140px; }
.table-orders-user .edit-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 14px;
}
.table-orders-user .edit-foot { display: flex; align-items: center; gap: 8px; }
.table-orders-user .edit-foot .btn { width: auto; }   /* 抵消 .cell-ops-u .btn 的整宽规则 */

/* 报单时的「是否认领」确认弹窗 */
.cl-ask-panel { width: min(520px, 100%); }
.cl-ask-tip { font-size: 14px; color: var(--text-2); line-height: 1.75; margin: 0 0 12px; }
.cl-ask-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-ask-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
}
.cl-ask-meta { color: var(--text); font-weight: 600; }
/* 弹窗底部的一句补充说明（「本批其余单号不受影响…」）：弱化处理，
   跟上面的 .cl-ask-tip 拉开层次，不跟正文抢注意力 */
.cl-ask-note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.cl-ask-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--line);
}

/* 窄屏不再靠横向滑动 —— 见下方媒体查询里的卡片化改造。
   这两条留作桌面/平板的兜底（真正的小屏由 .table-claim-user 卡片规则接管）。
   .table-claim 是**后台**扫码页（admin/scan.php）的表，那页只在电脑上用，
   所以保留原来的「窄屏横向滑动」行为不动，免得改了前后台不一致。 */
.claim-inline { margin-left: 0; }
@media (max-width: 480px) {
  .table-claim { min-width: 620px; }
}

/* ============================================================
   报单人端 · 认领中心 窄屏改造（≤720px）
   ------------------------------------------------------------
   改造前：`.table-claim-user { min-width: 620px }` —— 手机上整张表往右溢出，
   必须左右拖着看，还得对准一条线才能看清哪一格属于哪一行，误触率极高。
   改造后：每条包裹摊成一张卡片，字段竖着排，标题靠 ::before 补（表头藏掉），
   操作按钮独占一行且够大 —— 全程纵向滚动，零横向溢出。
   与 .table-orders-user 同一套思路，两处列表手感一致。
   ============================================================ */
@media (max-width: 720px) {
  /* 注意：横向滚动的真凶不只是原来那句 .table-claim-user{min-width:620px}，
     还有全局 .table 上的 min-width: 640px（535 行）—— 只干掉前者照样会溢出。
     这里两个都压掉；用 .table.table-claim-user 双类名提高特异性，
     免得依赖「谁的规则写在后面」这种一改顺序就翻车的隐含条件。 */
  .table.table-claim-user { min-width: 0; }
  .table-claim-user thead { display: none; }
  .table-claim-user,
  .table-claim-user tbody { display: block; }

  .table-claim-user tbody tr {
    display: block;
    position: relative;
    padding: 12px 13px;
    margin: 0 0 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .table-claim-user tbody tr:hover { background: var(--card); }
  .table-claim-user td {
    display: block;
    padding: 0;
    border: 0;
    white-space: normal;   /* 桌面靠 nowrap 防拆行；卡片里不需要，反而会撑出横向滚动 */
  }

  /* 单号：卡片第一行，字号给足（用户要对着包裹核对的），自带「单号」前缀 */
  .table-claim-user td.cl-no {
    font-size: 16px;
    letter-spacing: .04em;
    margin-bottom: 8px;
    padding-right: 74px;      /* 给右下角的「认领」按钮让位 */
    word-break: break-all;    /* 打码单号很长，宁可折行也不要溢出 */
  }
  .table-claim-user td.cl-no::before {
    content: '单号';
    display: block;
    font-size: 11.5px; font-weight: 400; color: var(--muted);
    letter-spacing: 0; margin-bottom: 2px;
    font-family: var(--sans, inherit);
  }

  /* 内容明细 / 时间：每个字段前面挂一个小标题，竖排比横表好读得多 */
  .table-claim-user td.cl-info,
  .table-claim-user td.cl-time {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-2);
    margin-top: 5px;
    word-break: break-word;
  }
  .table-claim-user td.cl-info::before,
  .table-claim-user td.cl-time::before {
    display: inline-block;
    width: 58px;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12.5px;
  }
  .table-claim-user td.cl-info::before { content: '明细'; }
  .table-claim-user td.cl-time::before { content: '入库'; }

  /* 我认领过的：多一列「状态」，也补上小标题 */
  .table-claim-user td.cl-st { margin-top: 5px; font-size: 13px; }
  .table-claim-user td.cl-st::before {
    content: '状态';
    display: inline-block; width: 58px; color: var(--muted); font-size: 12.5px;
  }
  /* 认领时间：桌面列头写「认领时间」，这里换成「认领」 */
  .table-claim-user td.cl-time.cl-claimed::before { content: '认领'; }

  /* 操作：整行按钮，手指友好。
     放在右上角绝对定位，不占横向空间，行首的单号也就不必为它留太多空。 */
  .table-claim-user td.cl-ops {
    position: absolute;
    top: 10px; right: 11px;
    margin: 0;
  }
  .table-claim-user td.cl-ops .btn {
    min-height: 34px;
    padding: 0 15px;
    font-size: 13.5px;
    border-radius: 999px;
  }
  .table-claim-user td.cl-ops .claim-inline { margin-left: 0; }

  /* 认领弹窗里的核对信息：窄屏把「标签 / 值」改成上下排，长单号不再被挤成一列字 */
  .cl-target-row { display: block; font-size: 13.5px; }
  .cl-k { display: block; flex: none; font-size: 12.5px; margin-bottom: 1px; }
  .cl-foot .btn, .cl-ask-foot .btn { min-height: 40px; }
}

/* 更窄的机器（≤380px，老 iPhone SE 一类）：再收一档，但点击区不缩 */
@media (max-width: 380px) {
  .table-claim-user tbody tr { padding: 11px 11px; }
  .table-claim-user td.cl-no { font-size: 15px; padding-right: 66px; }
  .table-claim-user td.cl-ops .btn { padding: 0 12px; font-size: 13px; }
  .table-claim-user td.cl-info::before,
  .table-claim-user td.cl-time::before,
  .table-claim-user td.cl-st::before { width: 50px; font-size: 12px; }
}

/* 时间列里的「入库 / 结算」前缀（桌面窄屏都保留：表头只写了列的范围，
   具体哪一行是哪一行还得看前缀） */
.cell-times .t-k { font-style: normal; }

/* ============================================================
   我的账单 · 搜索框下方的状态快捷筛选
   ------------------------------------------------------------
   四个状态标签 + 一个「全部」+ 条件性的「清空」。
   选中态用「深底白字」拉开差距 —— 只靠边框深浅在小屏上根本看不清哪个是选中的。
   每个标签右下角带该状态的条数（.st-chip 里的 <i>），一眼知道点下去有多少条。
   ============================================================ */
.st-filter {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 10px 0 12px;
}
.st-filter-lbl { color: var(--muted); font-size: 12.5px; flex: 0 0 auto; }
.st-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.st-chip:hover { border-color: var(--text-2); color: var(--text); }
.st-chip i {
  font-style: normal; font-family: var(--mono); font-size: 11.5px;
  color: var(--muted); background: var(--soft);
  border-radius: 999px; padding: 1px 6px; min-width: 20px; text-align: center;
}
/* 选中：深底白字，跟未选中的白底灰字形成明确对比 */
.st-chip.active {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
  font-weight: 600; box-shadow: var(--shadow-sm);
}
.st-chip.active i { background: rgba(255, 255, 255, .22); color: #fff; }
.st-chip.active:hover { color: var(--on-primary); }
/* 状态色点：让四个状态在未选中时也能靠颜色区分（选中时深底白字已足够醒目，不再加点） */
.st-chip:not(.active)::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); flex: 0 0 auto;
}
.st-chip-pending:not(.active)::before  { background: #f59e0b; }   /* 待入库 · 琥珀 */
.st-chip-instock:not(.active)::before { background: #3b82f6; }   /* 已入库 · 蓝 */
.st-chip-settling:not(.active)::before { background: #8b5cf6; }   /* 待结算 · 紫 */
.st-chip-settled:not(.active)::before  { background: #059669; }   /* 已结算 · 绿 */
.st-chip-clear { color: var(--danger); border-color: #fecdd3; background: #fff5f7; }
.st-chip-clear:hover { border-color: var(--danger); color: var(--danger); }
.st-chip-clear::before { display: none; }   /* 「清空」不是状态，不要色点 */

/* 空状态：比起一行灰字，给个图标 + 说明 + 出口按钮，用户知道下一步干嘛 */
.empty-box {
  text-align: center;
  padding: 34px 18px 38px;
  color: var(--text-2);
}
.empty-ico { font-size: 34px; line-height: 1; margin-bottom: 10px; opacity: .8; }
.empty-t { font-size: 15px; color: var(--text); margin: 0 0 6px; font-weight: 600; }
.empty-t b { font-family: var(--mono); }
.empty-s { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.empty-acts { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* 我的账单翻页条：复用全局 .pager / .pager-num / .pager-btn / .pager-per（见 1794 行那组）。
   这里只把「共 N 条 · 第 x/y 页」那行字往左推，页码居中更好看 */
.me-pager { justify-content: flex-start; }
.me-pager .pager-info { margin-right: auto; }

/* ============================================================
   我的账单 · 时间筛选（快捷区间 + 精确年月日）与「今日已结算」入口
   ------------------------------------------------------------
   三层结构，从「一键直达」到「精确定位」：
     ① .sd-row / .sd-chip   —— 今日已结算，单列一个高亮入口
     ② .df-tf               —— 按哪一列筛（报单 / 入库 / 结算时间）
     ③ .dfilter-quick       —— 今日 / 本周 / 本月 / 最近 7 天 + 自定义区间（点开是弹窗）
   ============================================================ */

/* ---------- ① 今日已结算 ---------- */
.sd-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px;
}
.sd-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 13.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.sd-chip:hover { border-color: #059669; box-shadow: var(--shadow-sm); }
.sd-chip .sd-ico { font-size: 14px; line-height: 1; }
/* 选中：实心深绿。跟未选中的浅绿底拉开距离 —— 小屏上只有底色深浅根本看不出选没选 */
.sd-chip.active {
  background: #059669; border-color: #047857; color: #fff;
  box-shadow: var(--shadow-sm);
}
.sd-chip.active:hover { color: #fff; }
.sd-chip i {
  font-style: normal; font-family: var(--mono); font-size: 11.5px;
  color: inherit;
  border-radius: 999px; padding: 1px 6px; min-width: 20px; text-align: center;
  background: rgba(5, 150, 105, .12);
}
.sd-chip.active i { background: rgba(255, 255, 255, .22); color: #fff; }
.sd-note { font-size: 12.5px; color: var(--muted); }

/* ---------- ② 时间维度切换 ---------- */
.df-tf {
  display: flex; align-items: center; gap: 0;
  margin: 0 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
  background: var(--card);
}
.df-tf-lbl {
  font-size: 12.5px; color: var(--muted);
  padding: 0 8px 0 12px;
}
.df-tf-tab {
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: none;
  border-left: 1px solid var(--line);
  white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.df-tf-tab:hover { background: var(--soft); color: var(--text); }
.df-tf-tab.active {
  background: var(--primary); color: var(--on-primary); font-weight: 600;
}

/* ---------- ③ 时间区间 ---------- */
.dfilter { margin: 0 0 12px; }
.dfilter-quick {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px;
}
.dfilter-lbl { color: var(--muted); font-size: 12.5px; flex: 0 0 auto; }
.df-chip::before { display: none; }   /* 时间标签不要状态色点 */

/* 精确区间：点「自定义区间」弹出居中弹窗（不再内联展开）。
   弹窗节点由 JS 挪到 <body> 末尾 —— 页面内容区被压在 body>* 的局部层叠上下文里
   （z-index:1），弹窗留在原地的话遮罩永远盖不住顶栏（z-index:10），
   挪到顶层后整体 z-index 才真正生效（与收款码灯箱同一做法）。 */
.dfilter-btn {
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--text-2);
  padding: 5px 2px;
  user-select: none;
  border: 0; background: none; font-family: inherit;
}
.dfilter-btn::before {
  content: '▸'; font-size: 11px; color: var(--muted);
}
.dfilter-btn:hover { color: var(--text); }

/* 触发器上直接展示当前生效的区间 */
.dfilter-cur {
  margin-left: 3px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 11.5px; font-weight: 600; color: var(--text);
  white-space: nowrap;
}

/* 弹窗本体：fixed + inset:0 + margin:auto 居中（不用 transform ——
   transform 会把 ::before 遮罩的 fixed 基准从视口变成面板自己，遮罩就盖不住全屏了） */
.dfilter-pop {
  position: fixed; z-index: 91;
  inset: 0; margin: auto;
  width: min(440px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 14px 14px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(2, 6, 23, .28);
  animation: dfilter-in .18s var(--ease);
}
.dfilter-pop[hidden] { display: none; }
/* 遮罩：pop 自身的伪元素。pop 有 fixed + z-index，自成层叠上下文，
   遮罩画在面板内容之下、随 pop 整体压过顶栏。
   点遮罩时事件 target 正好是 pop 本身，借这个特性实现「点空白处关闭」。 */
.dfilter-pop::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: rgba(15, 23, 42, .48);
  animation: dfilter-fade .16s var(--ease);
}
.dfilter-pop > * { position: relative; z-index: 1; }
.dfilter-pop-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 10px;
}
.dfilter-pop-head b { font-size: 14.5px; }
.dfilter-pop-x {
  flex: 0 0 auto;
  width: 30px; height: 30px; line-height: 1;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--text-2);
  font-size: 14px; cursor: pointer;
}
.dfilter-pop-x:hover { color: var(--text); border-color: var(--line-2); }
@keyframes dfilter-fade { from { opacity: 0; } }
@keyframes dfilter-in { from { opacity: 0; } }

.dfilter-form {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.dfilter-grp {
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.dfilter-grp-lbl {
  font-size: 12.5px; color: var(--text-2);
  flex: 0 0 auto; margin-right: 2px;
}
/* 年 / 月 / 日 三个小框：宽度固定且够点，避免手机上误触相邻框 */
.dfilter-form .df-y { width: 60px; }
.dfilter-form .df-m { width: 44px; }
.dfilter-form .df-d { width: 44px; }
.dfilter-form .input-mini { padding: 5px 7px; text-align: center; }
.dfilter-sep { color: var(--muted); font-size: 13px; }
.dfilter-acts { display: flex; align-items: center; gap: 8px; }
.dfilter-tip {
  font-size: 12px; color: var(--muted);
  margin: 8px 0 0; line-height: 1.6;
}

@media (max-width: 720px) {
  .dfilter-lbl { display: none; }
  .dfilter-quick { gap: 6px; }
  .dfilter-quick .st-chip { padding: 6px 10px; font-size: 12.5px; }
  /* 精确区间：三件套整组占满一行，间隔用 flex 撑开，手指不容易点错。
     min-width:0 必须给 —— input 和「从/到」这两组本身都是 flex 子项，
     默认 min-width:auto 会顶住收缩（input 固有宽度 ~150px），一行三个框
     直接把弹窗撑出横向滚动，第三个框被裁掉 */
  .dfilter-form { gap: 8px 6px; }
  .dfilter-grp { flex: 1 1 100%; min-width: 0; }
  .dfilter-grp .input-mini { flex: 1 1 auto; width: auto; min-width: 0; }
  .dfilter-form .df-y { flex: 1.4 1 0; }
  .dfilter-form .df-m,
  .dfilter-form .df-d { flex: 1 1 0; }
  .dfilter-sep { display: none; }   /* 上下两组各占一行，「→」反而是噪音 */
  .dfilter-acts { flex: 1 1 100%; }
  .dfilter-acts .btn { flex: 1 1 auto; }
  .df-tf { width: 100%; }
  .df-tf-tab { flex: 1 1 0; text-align: center; }
  .sd-chip { flex: 1 1 auto; justify-content: center; padding: 9px 12px; }
  .sd-note { display: none; }
}

@media (max-width: 720px) {
  .st-filter { gap: 6px; margin: 9px 0 10px; }
  .st-filter-lbl { display: none; }        /* 小屏省空间，标签本身就够表意 */
  .st-chip { padding: 5px 9px; font-size: 12.5px; }
  .st-chip i { padding: 0 5px; min-width: 18px; font-size: 11px; }
  .me-pager .pager-info { width: 100%; margin: 0 0 6px; }
}

/* 「报单时间」列：紧跟在「# 序号」后面。
   桌面是独立一列，表头已写「报单时间」，所以格子里不再重复前缀；
   窄屏表头被藏掉，靠 .m-k 补一个「报单」前缀（桌面隐藏，见下）。
   挤的时候在日期和时间之间折行（见上面 .table-orders-user 附近的 white-space 规则） */
.cell-rep {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cell-rep .m-k { display: none; font-style: normal; }
/* 日期 / 时间各自不折行：表格挤了只在日期和时间之间折，不在连字符处拆 */
.cell-rep .nw, .cell-times .nw { white-space: nowrap; }

/* 用户端记录列表：金额按状态显示——待入库不显示；已入库/待结算显示但标签是「待结算金额」；
   只有「已结算」才是「结算价格」。行上的 tr-pending / tr-pending-amount 由各页面 PHP 打上
   （桌面端金额格留空保持列对齐，卡片里的差异见 720px 媒体查询）。 */

/* ============================================================
   用户端记录列表 · 窄屏改卡片（≤720px）
   宽表在小屏上无论如何都会挤：单号被压成竖排、时间互相错位。
   每条记录摊成一张信息卡，按固定次序排布：
     #序号 + 报单时间（表头藏了，报单时间自带「报单」前缀）+ 状态
     → 快递单号（单号绝不截断）
     → 型号数量（下面跟着 我的备注 / 后台备注，后台备注不显示时间）
     → 结算价格
     → 入库时间 / 结算时间
     → 操作（备注 / 删除，只有批量报单页有）
   三处列表（批量报单 / 报单 / 我的账单）共用，少列的那几格留空即可。
   金额与时间各自占满整行：末行的宽度不再反过来撑大第一行的「状态」列，
   否则「#序号 + 报单时间」会被挤到换行。
   ============================================================ */
@media (max-width: 720px) {
  .table-orders-user { min-width: 0; }
  .table-orders-user thead { display: none; }
  .table-orders-user,
  .table-orders-user tbody { display: block; }

  .table-orders-user tbody tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "idx  rep  st"
      "no   no   no"
      "info info info"
      "amt  amt  amt"
      "time time time";
    gap: 7px 10px;
    padding: 12px 13px;
    margin: 0 0 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  /* 批量报单页多一列操作：单独起一行贴右，别跟序号/报单时间挤第一行 */
  .table-orders-user.has-ops tbody tr {
    grid-template-areas:
      "idx  rep  st"
      "no   no   no"
      "info info info"
      "amt  amt  amt"
      "time time time"
      "ops  ops  ops";
  }
  .table-orders-user tbody tr:hover { background: var(--card); }
  .table-orders-user td { display: block; padding: 0; border: 0; }
  tr.tr-has-remark > td { background: transparent; }   /* 卡片自带底色，别再叠一层行高亮 */

  /* 第一行：序号 + 报单时间（紧跟序号）+ 状态 */
  .table-orders-user .cell-idx {
    grid-area: idx; align-self: center;
    font-size: 13px; color: var(--muted); font-family: var(--mono);
  }
  .table-orders-user .cell-idx::before { content: '#'; }
  .table-orders-user .cell-rep {
    grid-area: rep; align-self: center; justify-self: start;
    width: auto; white-space: nowrap;
    font-size: 11.5px; font-weight: 400; color: var(--muted); letter-spacing: 0;
    overflow: hidden;
  }
  .table-orders-user .cell-rep .m-k { display: inline; margin-right: 3px; }
  .table-orders-user .cell-ops-u {
    grid-area: ops; justify-self: end; align-self: center;
    flex-direction: row; align-items: center; gap: 6px;
  }
  .table-orders-user .cell-ops-u .btn { width: auto; }
  .table-orders-user .cell-st { grid-area: st; justify-self: end; align-self: center; }

  /* 快递单号（单号永不截断） */
  .table-orders-user .cell-no {
    grid-area: no;
    display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 2px 10px;
    font-size: 15px;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
  }
  .table-orders-user .cell-no .tk-cell { flex-wrap: nowrap; gap: 8px; }

  /* 型号数量（含备注块） */
  .table-orders-user .cell-info-u { grid-area: info; word-break: break-word; }
  .table-orders-user .cell-info-u::before {
    content: '型号数量';
    display: inline-block; width: 62px;
    color: var(--muted); font-weight: 400;
  }
  .table-orders-user .rk-at { display: none; }   /* 后台备注不显示时间 */

  /* 结算价格（整行） */
  .table-orders-user .cell-amount-u {
    grid-area: amt; align-self: center;
    display: flex; align-items: baseline;
  }
  .table-orders-user .cell-amount-u::before {
    content: '结算价格';
    display: inline-block; width: 62px;
    color: var(--muted); font-weight: 400;
  }
  .table-orders-user .cell-amount-u .u-amt { font-size: 17px; }
  /* 待入库：整格隐藏（此时是 grid 布局，不影响别的格子）；
     已入库 / 待结算：标签由「结算价格」换成「待结算金额」（5 个字，宽度跟着放大一点） */
  .table-orders-user tr.tr-pending .cell-amount-u,
  .table-orders-user tr.tr-pending .cell-times { display: none; }   /* 待入库：两个时间都还没有，整段留白收掉 */
  .table-orders-user tr.tr-pending-amount .cell-amount-u::before {
    content: '待结算金额'; width: 76px;
  }
  /* 入库时间 / 结算时间（整行，两行上下码放） */
  .table-orders-user .cell-times {
    grid-area: time; align-self: center;
    display: flex; flex-direction: column; gap: 3px;
  }
  .table-orders-user .cell-times > .t-line { display: flex; align-items: baseline; }
  .table-orders-user .cell-times .t-k { flex: 0 0 auto; margin-right: 2px; }

  /* 行内编辑区在卡片模式下单独成块（不参与上面那张信息卡的网格），
     底下再垫一条分隔线，让它明显属于「上一张卡」而不是自己一张卡 */
  .table-orders-user tr.tr-edit {
    display: block;
    margin: -10px 0 10px;                 /* 贴住上面那张卡（卡片本身有 10px 下边距） */
    border: 1px solid var(--line);
    border-top: 0;                        /* 与上面的卡片拼成一块，不留缝 */
    border-radius: 0 0 12px 12px;
    background: var(--panel);
  }
  /* 必须显式压掉浏览器自带的 [hidden]{display:none}：
     那条是**元素属性选择器**，特异性 (0,1,0)，低于本条的 (0,2,1)，
     所以一旦给 tr 写了 display:block，"hidden 属性" 就再也藏不住它 ——
     表现就是「没点展开，编辑框也一直露在外面」。
     这里用带 [hidden] 的更高特异性选择器把它盖回来。 */
  .table-orders-user tr.tr-edit[hidden] { display: none; }
  .table-orders-user tr.tr-edit > td { display: block; padding: 11px 13px; background: transparent; }
  /* 同理：卡片模式下 td 被写成 display:block，但编辑区里那些 hidden 的格子/元素也要真的藏住 */
  .table-orders-user tr.tr-edit [hidden] { display: none; }
  .table-orders-user .edit-form .md-list { max-width: 100%; }
  .table-orders-user .edit-form .md-row input[name="models[]"] { min-width: 0; flex: 1 1 auto; }
  .table-orders-user .edit-foot .btn { flex: 0 0 auto; }
}

/* ============================================================
   管理后台 · Dashboard Layout（仪表盘布局）
   ------------------------------------------------------------
   深色侧边导航（gray-900 w-64）+ 白色顶部工具栏（搜索 / 通知 / 用户）
   + 主区（KPI 卡片 grid-cols-4 / 图表面板 / 数据表格）
   仅作用于 body.scope-admin —— 用户端不受影响。
   ============================================================ */
body.scope-admin {
  background: #f9fafb;          /* 背景主色 */
  color: #111827;               /* 正文主色 */
}
body.scope-admin::before { display: none; }   /* 扁平底色，不要暖光渐变 */

/* ---------- 左侧：深色侧边导航 ---------- */
.adm-side {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 60;
  width: 256px;                 /* w-64 */
  display: flex;
  flex-direction: column;
  background: #111827;          /* gray-900 */
  color: #9ca3af;               /* gray-400 */
}
.adm-side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.adm-logo {
  width: 34px; height: 34px; flex: 0 0 auto;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}
.adm-logo-fb {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  font-size: 17px;
}
.adm-brand-txt { display: flex; flex-direction: column; min-width: 0; }
.adm-brand-txt b {
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: #f9fafb;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adm-brand-txt i { font-style: normal; font-size: 12px; color: #6b7280; }

.adm-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-nav-sep { height: 1px; margin: 10px 8px; background: rgba(255, 255, 255, .08); }
.adm-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;            /* rounded-lg */
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.adm-link:hover { background: rgba(255, 255, 255, .06); color: #f9fafb; }
.adm-link.active { background: rgba(255, 255, 255, .10); color: #ffffff; font-weight: 600; }
.adm-link:focus-visible { outline: none; box-shadow: 0 0 0 2px #111827, 0 0 0 4px #6366f1; }
.adm-link-ico { width: 20px; flex: 0 0 auto; text-align: center; font-size: 15px; line-height: 1; }
.adm-link-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.adm-side-foot {
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adm-me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-ava {
  width: 32px; height: 32px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: #6366f1;
  color: #ffffff;
  font-size: 14px; font-weight: 600;
}
.adm-ava-sm { width: 26px; height: 26px; font-size: 12px; }
.adm-me-txt { display: flex; flex-direction: column; min-width: 0; }
.adm-me-txt b {
  font-size: 13.5px; font-weight: 600; color: #f3f4f6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adm-me-txt i { font-style: normal; font-size: 12px; color: #6b7280; }
.adm-logout {
  display: block;
  text-align: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #d1d5db;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.adm-logout:hover { background: rgba(239, 68, 68, .18); color: #fca5a5; }

.adm-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(17, 24, 39, .5);
}
.adm-scrim[hidden] { display: none; }

/* ---------- 顶部：白色工具栏 ---------- */
.adm-top {
  position: sticky;
  top: 0;
  z-index: 50;
  margin-left: 256px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}
.adm-top-inner {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.adm-burger {
  display: none;
  width: 36px; height: 36px;
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 150ms var(--ease);
}
.adm-burger:hover { background: #f9fafb; }
.adm-top-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 搜索：灰底圆角输入，聚焦时 indigo 光环 */
.adm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 320px;
  min-width: 0;
  height: 36px;
  margin-left: auto;
  padding: 0 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease);
}
.adm-search:focus-within {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}
.adm-search-ico { font-size: 13px; opacity: .6; line-height: 1; flex: 0 0 auto; }
.adm-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #111827;
  font-size: 13.5px;
  font-family: inherit;
}
.adm-search-input::placeholder { color: #9ca3af; }
.adm-search-input::-webkit-search-cancel-button { cursor: pointer; }

/* 通知铃铛 + 用户菜单 */
.adm-pop-wrap { position: relative; flex: 0 0 auto; }
.adm-icon-btn {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}
.adm-icon-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.adm-badge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
}
.adm-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  max-width: 160px;
  padding: 0 10px 0 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}
.adm-chip:hover { background: #f9fafb; border-color: #d1d5db; }
.adm-chip-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.adm-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 224px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;           /* rounded-xl */
  box-shadow: 0 4px 14px -4px rgba(17, 24, 39, .12), 0 1px 2px rgba(17, 24, 39, .06);
}
.adm-pop[hidden] { display: none; }
.adm-pop-head {
  padding: 7px 10px 8px;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adm-pop-empty { padding: 10px; font-size: 13px; color: #9ca3af; }
.adm-pop-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 13.5px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.adm-pop-item:hover { background: #f9fafb; color: #111827; }
.adm-pop-item.tone-warn { color: #b45309; }
.adm-pop-item.tone-warn:hover { background: #fffbeb; }
.adm-pop-item.tone-bad { color: #dc2626; }
.adm-pop-item.tone-bad:hover { background: #fef2f2; }
.adm-pop-ico { width: 18px; flex: 0 0 auto; text-align: center; font-size: 13px; }
.adm-pop-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 主区 ---------- */
body.scope-admin .main {
  max-width: none;
  margin: 0 0 0 256px;
  padding: 24px 20px 48px;
  gap: 18px;
}
body.scope-admin .card {
  border-radius: 12px;           /* rounded-xl */
  border-color: #f3f4f6;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .05);
  padding: 20px;
}
body.scope-admin .card:hover { box-shadow: 0 1px 2px rgba(17, 24, 39, .05); }
body.scope-admin .card-title { font-size: 16px; margin-bottom: 0; }
body.scope-admin .list-head { margin-bottom: 16px; }

/* 按钮 / 输入框：indigo 主色（仅后台） */
body.scope-admin .btn {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  background: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
body.scope-admin .btn:hover { background: #4f46e5; border-color: #4f46e5; transform: none; box-shadow: none; }
body.scope-admin .btn:active { transform: scale(.97); box-shadow: none; }
body.scope-admin .btn-danger { background: #ef4444; border-color: #ef4444; }
body.scope-admin .btn-danger:hover { background: #dc2626; border-color: #dc2626; }
/* 「标记已结算」：绿色，压过后台 indigo 主色（这条得跟在 body.scope-admin .btn 后面才盖得住） */
body.scope-admin .btn-settle { background: #059669; border-color: #059669; }
body.scope-admin .btn-settle:hover { background: #047857; border-color: #047857; }
body.scope-admin .btn-ghost {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #374151;
}
body.scope-admin .btn-ghost:hover { background: #f9fafb; border-color: #d1d5db; color: #111827; }
body.scope-admin .btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }

body.scope-admin .input,
body.scope-admin .select {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13.5px;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background-color 150ms var(--ease);
}
body.scope-admin .input:focus,
body.scope-admin .select:focus {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}
body.scope-admin .input-mini { background: #ffffff; }
body.scope-admin .table th { background: #f9fafb; border-bottom-color: #e5e7eb; }
body.scope-admin .table tbody tr:hover { background: #f9fafb; }

/* ---------- KPI 卡片（grid grid-cols-4） ---------- */
.kpi-grid {
  display: grid;
  /* 默认 4 列；卡片数随权限浮动时由 --kpi-cols 收窄，避免一行里留空槽 */
  grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr));
  gap: 16px;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .05);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), border-color 150ms var(--ease);
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px -4px rgba(17, 24, 39, .12);
  border-color: #e5e7eb;
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 13px; color: #6b7280; line-height: 1.4; }
.kpi-ico {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: #f3f4f6;
  font-size: 16px;
  transition: background-color 150ms var(--ease);
}
.kpi:hover .kpi-ico { background: #eef2ff; }
.kpi-val {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: #111827;
  font-variant-numeric: tabular-nums;
  transition: color 150ms var(--ease), transform 150ms var(--ease);
  transform-origin: left center;
}
.kpi:hover .kpi-val { color: #4f46e5; transform: scale(1.02); }
.kpi-unit { font-size: 15px; font-weight: 500; color: #6b7280; margin-left: 3px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.kpi-trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.kpi-trend.up   { color: #10b981; }   /* 绿 = 增 */
.kpi-trend.down { color: #ef4444; }   /* 红 = 减 */
.kpi-trend.flat { color: #f59e0b; }   /* 黄 = 平 */
.kpi-hint { color: #9ca3af; font-weight: 400; }
.kpi-sub { font-size: 12px; color: #9ca3af; line-height: 1.5; }

/* ---------- 图表面板（主图 2/3 + 辅助图 1/3，两张卡等高） ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: stretch;            /* 两张卡拉齐到同一高度，右侧不再比左侧矮一截 */
}
.dash-grid > .card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;              /* 图表卡比普通卡再收一点，整体不显臃肿 */
}
.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.chart-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: #111827; }
.chart-sub { font-size: 12px; color: #9ca3af; }
.chart-box { width: 100%; aspect-ratio: 720 / 240; }      /* 3:1 扁图，电脑端不再占满半屏 */
.chart-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-box-sq { width: 100%; max-width: 165px; margin: 0 auto; aspect-ratio: 1 / 1; }
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 120px;
  font-size: 13px;
  color: #9ca3af;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
}
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: #6b7280; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-dot { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.chart-dot-line { width: 14px; height: 3px; border-radius: 2px; flex: 0 0 auto; }

/* 状态分布：环形图 + 图例 */
.donut-wrap { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; justify-content: center; }
.donut-center-txt { font-size: 20px; font-weight: 600; fill: #111827; }
.donut-center-lb { font-size: 11px; fill: #9ca3af; }
.donut-list { display: flex; flex-direction: column; gap: 6px; }
.donut-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #374151; }
.donut-row .chart-dot { width: 8px; height: 8px; border-radius: 50%; }
.donut-row b { margin-left: auto; font-weight: 600; color: #111827; font-variant-numeric: tabular-nums; }
.donut-row i { font-style: normal; color: #9ca3af; width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 响应式 ---------- */
/* 1280 这档要保住 4 列（含 1280 宽的平板），所以断点压到 1279 */
@media (max-width: 1279px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  /* 小屏：侧边栏收起成抽屉，主区占满 */
  .adm-side {
    transform: translateX(-100%);
    transition: transform 200ms var(--ease);
  }
  /* 压暗整页交给 .adm-scrim（可点击关闭）；抽屉本身只带一点右侧投影 */
  .adm-side.open { transform: none; box-shadow: 8px 0 24px rgba(17, 24, 39, .25); }
  .adm-top { margin-left: 0; }
  body.scope-admin .main { margin-left: 0; padding: 16px 14px 40px; }
  .adm-burger { display: inline-flex; align-items: center; justify-content: center; }
  .adm-top-title { display: none; }
  .adm-search { flex: 1 1 auto; }
}

/* ---------- 用户端移动端抽屉（复用后台侧栏同一套样式与交互） ----------
   用户端顶栏在 ≤1000px 会把导航折到第二行，手机上仍占一大截；
   ≤900px 起改成跟后台一样：左上角汉堡，点开抽屉。
   桌面 / 大平板上抽屉与汉堡整体 display:none，顶栏维持原来的一排。

   遮罩要单独写 `:not([hidden])`：上面那条把 .adm-scrim 一并 display:none 了，
   这里再写一条同权重的 display:block 会连 [hidden] 一起盖掉（遮罩永久铺着，
   或者干脆不显示 —— 不显示的结果就是「点空白处收不起来」）。 */
.scope-user .adm-side,
.scope-user .adm-scrim,
.scope-user .adm-burger { display: none; }
@media (max-width: 900px) {
  .scope-user .nav { display: none; }        /* 顶栏不再摆一排菜单，只留 汉堡 + 品牌 + 账号/退出 */
  .scope-user .adm-burger { display: inline-flex; align-items: center; justify-content: center; }
  .scope-user .adm-side {
    display: flex;
    transform: translateX(-100%);
    transition: transform 200ms var(--ease);
    overflow-y: auto;
    max-width: 84vw;
  }
  .scope-user .adm-side.open { transform: none; box-shadow: 8px 0 24px rgba(17, 24, 39, .25); }
  /* 打开时才铺开：点它（抽屉右边那条）即收起，这是「点空白处关闭」的唯一命中区。
     cursor:pointer 不只是桌面好看 —— iOS Safari 对「没有指针样式的普通 div」
     有时不派发 click，加上它才稳。 */
  .scope-user .adm-scrim:not([hidden]) { display: block; cursor: pointer; }
  .scope-user .adm-link { min-height: 46px; padding-top: 11px; padding-bottom: 11px; }
  body.adm-nav-open { overflow: hidden; }    /* 抽屉铺满屏时锁住页面滚动 */
}
@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .adm-top-inner { padding: 0 14px; gap: 10px; }
  .adm-chip-txt { display: none; }
  .adm-chip { padding: 0 6px; }
}

/* ---------- 单号复制按钮 + 轻提示（用户端 / 后台端共用，不挂 scope 前缀） ---------- */
/* 按钮：紧跟在单号后面的小图标按钮，安静一点，hover 才亮成主色 */
.cpy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  margin-left: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #9ca3af;
  cursor: pointer;
  vertical-align: middle;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease), transform 100ms var(--ease);
}
.cpy-btn:hover { color: #4f46e5; border-color: #c7d2fe; background: #eef2ff; }
.cpy-btn:active { transform: scale(.92); }
.cpy-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 1px; }
.cpy-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cpy-btn.cpy-done { color: #10b981; border-color: #a7f3d0; background: #ecfdf5; }

/* 复制提示：屏幕中下一条深色小提示，显示 1 秒后淡出（层级压在所有弹窗之上） */
.cpy-toast {
  position: fixed;
  left: 50%;
  bottom: 14vh;
  z-index: 10050;
  padding: 9px 16px;
  border-radius: 8px;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.cpy-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 窄屏：单号整行显示的列表里，按钮别把单号挤到换行 */
@media (max-width: 720px) {
  .cpy-btn { width: 24px; height: 24px; margin-left: 5px; }
  .cpy-btn svg { width: 14px; height: 14px; }
}

/* ============================================================
   库存管理（admin/stock.php）
   型号 × 日期 的入库数量矩阵 + 入库明细表
   ============================================================ */
.stock-matrix { border-collapse: separate; border-spacing: 0; }
.stock-matrix th,
.stock-matrix td { white-space: nowrap; }
.stock-matrix th.num,
.stock-matrix td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-matrix td.zero { color: #d4d4d8; }
.stock-matrix td.is-today,
.stock-matrix th.is-today { box-shadow: inset 1px 0 0 #dbeafe, inset -1px 0 0 #dbeafe; background: #f8fbff; }
.stock-matrix .sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  text-align: left;
  font-weight: 600;
  min-width: 120px;
}
.stock-matrix thead .sticky-col { z-index: 3; background: var(--soft); }
.stock-matrix tfoot th.sticky-col { background: #f8fafc; }
.stock-matrix .col-total { font-weight: 700; color: var(--text); }
.stock-matrix tfoot th,
.stock-matrix tfoot td { background: #f8fafc; font-weight: 700; }
.stock-note { margin-top: 10px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

.src-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}
.src-tag.src-scan  { background: #eef2ff; color: #4338ca; }
.src-tag.src-claim { background: #ecfdf5; color: #047857; }
.src-tag.src-manual { background: #fffbeb; color: #b45309; }   /* 后台手动标记入库：和扫出来的区分开 */
.src-tag.src-unclaimed { background: #faf5ff; color: #7e22ce; }   /* 无主件待认领：实物在仓、还没归属 */

/* 待认领的无主件行：淡紫底，一眼看出这批还没归属 */
.table-stock-log tr.row-pending-claim td { background: #faf5ff; }

.table-stock-log td { vertical-align: top; }
@media (max-width: 720px) {
  .stock-matrix th, .stock-matrix td { padding: 7px 9px; font-size: 13px; }
  .stock-matrix .sticky-col { min-width: 92px; }
}

/* ============================================================
   验证码（登录 / 注册，assets/captcha.js 渲染）
   ============================================================ */
.cap {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 12px;
  margin: 4px 0 16px;
}
.cap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cap-label { font-size: 14px; font-weight: 600; color: var(--text); }
.cap-refresh {
  font-size: 13px; color: #2563eb; text-decoration: none; cursor: pointer; user-select: none;
}
.cap-refresh:hover { text-decoration: underline; }

.cap-stage {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
  line-height: 0;
}
.cap-stage img { max-width: 100%; display: block; }
.cap-img-bg, .cap-img-main { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.cap-img-piece {
  position: absolute;
  left: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .35);
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}
.cap-loading { line-height: 90px; text-align: center; color: var(--muted); font-size: 14px; }

/* 点击标记（文字点选） */
.cap-dots { position: absolute; inset: 0; pointer-events: none; }
.cap-dot {
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .88);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .4);
}
.cap-dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, .5);
}

/* 滑动拼图滑块 */
.cap-slider {
  position: relative;
  height: 42px;
  margin-top: 10px;
  border-radius: 6px;
  background: var(--soft);
  border: 1px solid var(--line-2);
  overflow: hidden;
  touch-action: none;
}
.cap-slider-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: #dbeafe;
}
.cap-slider-text {
  position: absolute;
  inset: 0;
  text-align: center;
  line-height: 40px;
  font-size: 13.5px;
  color: var(--muted);
  pointer-events: none;
}
.cap-slider-btn {
  position: absolute;
  top: 0;
  width: 46px; height: 100%;
  background: #2563eb;
  color: #fff;
  font-size: 18px;
  line-height: 40px;
  text-align: center;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .3);
}
.cap-slider-btn:active { cursor: grabbing; }

/* 提示行与消息 */
.cap-tip-row { margin-top: 10px; }
.cap-tip-drag { display: none; }   /* 滑块里已有引导文字，外置提示只留给点选/数字 */
.cap-prompt { font-size: 14.5px; color: var(--text-2); line-height: 1.9; }
.cap-prompt-label { color: var(--muted); }
.cap-prompt-ch {
  display: inline-block;
  min-width: 30px;
  padding: 1px 6px;
  margin-right: 6px;
  text-align: center;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--soft);
  font-size: 16px;
  color: var(--text);
}
.cap-num-row { display: flex; gap: 8px; }
.cap-num-input { flex: 1 1 auto; min-width: 0; letter-spacing: 4px; }
.cap-num-btn { flex: none; }
.cap-msg { margin-top: 8px; min-height: 18px; font-size: 13.5px; }
.cap-msg-ok { color: var(--ok); font-weight: 600; }
.cap-msg-err { color: var(--danger); font-weight: 600; }
.cap-shake { animation: cap-shake .3s; }
@keyframes cap-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.cap-ok .cap-stage { opacity: .72; }

/* ---------- 安全验证弹窗（登录 / 注册页，data-mode="modal"） ---------- */
body.cap-modal-open { overflow: hidden; }
.cap-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cap-modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .52); }
.cap-modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .3);
  padding: 16px 16px 18px;
}
.cap-modal-hd { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--text); }
.cap-modal-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
.cap-modal-close:hover { background: var(--soft); color: var(--text); }
.cap-modal-body .cap { border: 0; padding: 0; margin: 0; }
.cap-head-right { justify-content: flex-end; }

/* ============================================================
   建议反馈中心（后台列表 + 用户端提交，两侧共用同一套类名）
   .fb-item 左边一条状态色条：待处理=玫红（等人管）、处理中=琥珀（在做）、已处理=绿（完结）
   ============================================================ */
.fb-list { display: flex; flex-direction: column; gap: 10px; }

.fb-item {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 12px 14px;
}
.fb-item.fb-st-pending    { border-left-color: #e11d48; }
.fb-item.fb-st-processing { border-left-color: #f59e0b; }
.fb-item.fb-st-done       { border-left-color: #16a34a; }

.fb-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 8px;
}
.fb-cat {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text-2);
}
.fb-cat-suggest { background: #eef2ff; color: #4338ca; }
.fb-cat-bug     { background: #fef2f2; color: #dc2626; }
.fb-cat-other   { background: #f1f5f9; color: #475569; }

.fb-user { font-size: 13.5px; color: var(--text); }
.fb-phone { font-size: 12px; color: var(--muted); font-style: normal; }
.fb-contact { font-size: 12px; color: #0f766e; }
.fb-time { font-size: 12px; color: var(--muted); margin-left: auto; }

.fb-st {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}
.fb-st-badge-pending    { background: #fef2f2; color: #dc2626; }
.fb-st-badge-processing { background: #fffbeb; color: #b45309; }
.fb-st-badge-done       { background: #ecfdf5; color: #047857; }

.fb-body {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
}

/* 官方回复：绿色左边条，与用户内容区分开 */
.fb-reply {
  margin-top: 10px;
  padding: 9px 12px;
  border-left: 3px solid #16a34a;
  border-radius: 0 8px 8px 0;
  background: #f6fdf9;
}
.fb-reply-hd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 3px; }
.fb-reply-k { font-size: 11.5px; font-weight: 700; color: #047857; }
.fb-reply-t { font-size: 11.5px; color: var(--muted); }
.fb-reply-body { font-size: 13px; line-height: 1.7; color: var(--text); word-break: break-word; }

/* 处理区：默认折叠，不占版面 */
.fb-ops { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.fb-ops > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.fb-ops > summary::-webkit-details-marker { display: none; }
.fb-ops > summary::before {
  content: "\25B8";
  font-size: 11px;
  color: var(--muted);
  transition: transform .2s var(--ease);
}
.fb-ops[open] > summary::before { transform: rotate(90deg); }
.fb-ops > summary:hover { color: var(--text); }

.fb-ops-body {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.fb-ops-body .fb-form { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.fb-ops-body .fb-form .field { margin: 0; }
.fb-ops-body .fb-form .btn { align-self: flex-start; }
.fb-del-form { flex: none; }

/* 用户端提交表单 */
.fb-submit { display: flex; flex-direction: column; gap: 14px; }
.fb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-cat-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.fb-cat-pick > span {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.fb-cat-pick > span:hover { border-color: var(--text); color: var(--text); }
.fb-cat-pick input:checked + span {
  background: var(--text);
  border-color: var(--text);
  color: var(--card);
  font-weight: 600;
}
.fb-cat-pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.fb-textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.fb-count { margin-top: 4px; text-align: right; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.fb-tip { margin: 0; font-size: 12.5px; text-align: center; }

/* 后台筛选行里的反馈状态点 */
.st-tab.st-fb-pending::before    { background: #e11d48; }
.st-tab.st-fb-processing::before { background: #f59e0b; }

@media (max-width: 640px) {
  .fb-head { gap: 5px 8px; }
  .fb-time { margin-left: 0; width: 100%; }      /* 时间另起一行，别把标签挤变形 */
  .fb-ops-body { padding: 10px; }
  .fb-ops-body .fb-form { flex: 1 1 100%; }
}

/* ============================================================
   后台 · 窄屏（≤720px）手机管理适配
   ------------------------------------------------------------
   后台大多是「一行一单」的宽表，手机上靠横向拖拽很难用：
   给列表型表格加 .card-table，窄屏下整行变成一张卡片 ——
   表头藏起来，每格上方显示列名（列名由 page_footer 的脚本
   从 thead 自动搬到 td[data-label]，不用逐页改模板）。

   矩阵 / 日历这类二维表不加 .card-table，仍走横向滚动 + 吸附首列。
   ============================================================ */
@media (max-width: 720px) {

  /* ---------- 1. 列表表格 → 卡片 ---------- */
  /* 桌面那几条 min-width（!important）在窄屏要全部让位，否则卡片会被撑宽 */
  .scope-admin .card-table,
  .scope-admin .card-table.table-orders-admin,
  .scope-admin .card-table.table-users,
  .scope-admin .card-table.table-logs,
  .scope-admin .card-table.table-risk-ip,
  .scope-admin .card-table.table-jobs,
  .scope-admin .card-table.table-narrow { min-width: 0 !important; }

  .scope-admin .card-table { display: block; border: 0; background: transparent; }
  .scope-admin .card-table > thead { display: none; }
  .scope-admin .card-table > tbody { display: block; }

  .scope-admin .card-table > tbody > tr {
    position: relative;
    display: block;
    margin: 0 0 10px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
  }
  .scope-admin .card-table > tbody > tr:last-child { margin-bottom: 0; }
  .scope-admin .card-table > tbody > tr:hover { background: var(--card); }
  /* 行级弱提示（登录失败等）在卡片上留一条左色条，不再靠整行背景 */
  .scope-admin .card-table > tbody > tr.row-fail { box-shadow: inset 3px 0 0 #fca5a5; }

  .scope-admin .card-table td {
    display: block;
    width: auto !important;
    max-width: none !important;
    padding: 0;
    border: 0;
    white-space: normal;
    word-break: break-word;
  }

  /* 列名：由脚本从 thead 搬过来，卡片里显示在每格内容上方 */
  .scope-admin .card-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin: 9px 0 2px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    color: #9ca3af;
  }
  .scope-admin .card-table td.card-lead[data-label]::before { margin-top: 0; }

  /* 空格子（脚本判定：既没文字也没控件）不占位置，卡片才不会又长又空 */
  .scope-admin .card-table td.is-empty { display: none; }

  /* 勾选框：浮到卡片右上角，不跟内容抢行 */
  .scope-admin .card-table td.card-check {
    position: absolute;
    top: 11px;
    right: 12px;
    width: auto !important;
  }
  .scope-admin .card-table td.card-check::before { display: none; }
  .scope-admin .card-table td.card-check input { width: 20px; height: 20px; }

  /* 操作区：卡片最底一整行，按钮等宽排布，手指点得到 */
  .scope-admin .card-table td.card-ops {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line-2);
  }
  .scope-admin .card-table td.card-ops::before { display: none; }
  .scope-admin .card-table td.card-ops .btn,
  .scope-admin .card-table td.card-ops button {
    flex: 1 1 auto;
    min-height: 38px;
    justify-content: center;
    font-size: 14px;
  }
  .scope-admin .card-table td.card-ops form,
  .scope-admin .card-table td.card-ops .inline-form { margin: 0; display: inline-flex; flex: 1 1 auto; }
  .scope-admin .card-table td.card-ops .btn + .btn { margin-left: 0; }

  /* 卡片的头一格（通常是时间/单号）给点强调 */
  .scope-admin .card-table td.card-lead .input,
  .scope-admin .card-table td.card-lead .mono { font-size: 14px; }

  /* ---------- 2. 卡片里的表单控件 ---------- */
  .scope-admin .card-table td .input,
  .scope-admin .card-table td select,
  .scope-admin .card-table td textarea {
    width: 100% !important;
    max-width: 100%;
    font-size: 14px;
    padding: 8px 10px;
    min-height: 38px;
  }
  .scope-admin .card-table td input[type="checkbox"],
  .scope-admin .card-table td input[type="radio"] { width: auto !important; min-height: 0; }
  .scope-admin .card-table td textarea { min-height: 64px; line-height: 1.6; }
  /* 型号 × 数量 这类小组合：整体吃满宽度，两个框并排 */
  .scope-admin .card-table .md-list { gap: 6px; }
  .scope-admin .card-table .md-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
  .scope-admin .card-table .md-row input { flex: 1 1 auto; width: auto !important; min-width: 0; }
  .scope-admin .card-table .md-row input[name="quantities[]"] { flex: 0 0 78px; }
  .scope-admin .card-table .amt-input { width: 100% !important; }

  /* ---------- 3. 批量操作栏：吸底长驻，勾完就地点 ---------- */
  .scope-admin .batch-bar {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 -6px 18px rgba(17, 24, 39, .10), 0 0 0 1px var(--line);
  }
  .scope-admin .batch-bar form { gap: 8px; }
  .scope-admin .batch-tip { flex: 0 0 100%; }
  .scope-admin .batch-grp { flex: 1 1 auto; }
  .scope-admin .batch-grp-end { margin-left: 0; flex: 1 1 100%; }
  .scope-admin .batch-grp .input,
  .scope-admin .batch-grp .select { flex: 1 1 auto; min-width: 0; }
  .scope-admin .batch-bar .btn { min-height: 38px; flex: 1 1 auto; font-size: 14px; }
  .scope-admin .batch-amt { width: auto; }

  /* ---------- 4. 筛选区：控件整宽，一个一行 ---------- */
  .scope-admin .filter-row .select,
  .scope-admin .filter-row .filter-input,
  .scope-admin .filter-row .input { flex: 1 1 100%; width: 100%; font-size: 14px; min-height: 38px; }
  .scope-admin .filter-row .btn { min-height: 38px; }
  .scope-admin .date-range { flex: 1 1 100%; flex-wrap: wrap; }

  /* ---------- 5. 侧栏抽屉：项高加大 + 打开时锁滚动 ---------- */
  .scope-admin .adm-link { min-height: 46px; padding-top: 11px; padding-bottom: 11px; }
  .scope-admin .adm-side { overflow-y: auto; max-width: 84vw; }   /* 右边始终留一条遮罩，点它就能关 */
  body.adm-nav-open { overflow: hidden; }

  /* ---------- 6. 二维表（库存矩阵等）：吸附首列 + 加大触控 ---------- */
  .scope-admin .stock-matrix .sticky-col {
    min-width: 84px;
    box-shadow: 2px 0 6px -2px rgba(17, 24, 39, .12);
  }
  .scope-admin .table-wrap { -webkit-overflow-scrolling: touch; }

  /* ---------- 7. 弹窗（物流 / 收款信息 / 认领明细）贴近全屏 ---------- */
  .scope-admin .tk-panel,
  .scope-admin .pay-panel { max-height: 88vh; }
  .scope-admin .tk-close,
  .scope-admin .pay-close { min-width: 40px; min-height: 40px; }

  /* ---------- 8. 反馈中心等卡片式列表：按钮整宽更好按 ---------- */
  .scope-admin .fb-ops-body .btn { min-height: 38px; }

  /* ---------- 9. KPI / 图表：数字小一点，别顶破卡片 ---------- */
  .scope-admin .kpi-val { font-size: 22px; }
  .scope-admin .kpi-grid { gap: 10px; }
}

/* 用户端账单卡片（≤720px）：金额格是 flex，扣减小字跟在金额后面，留条缝不贴在一起 */
@media (max-width: 720px) {
  .table-orders-user .cell-amount-u { gap: 6px; }
  .table-orders-user .u-deduct { max-width: none; }
}

/* ---------- 通用确认弹窗（page_footer 注入，替代浏览器原生 confirm 白框） ---------- */
.cfd-mask {
  position: fixed;
  inset: 0;
  z-index: 10050;   /* 盖过物流 / 收款信息弹窗（10000），确认框永远在最上层 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 9, 11, .5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.cfd-mask[hidden] { display: none; }

.cfd-card {
  width: min(380px, 100%);
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  padding: 26px 22px 18px;
  text-align: center;
  animation: cfdIn .16s var(--ease);
}
@keyframes cfdIn {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cfd-card { animation: none; } }

/* 图标：一般操作是靛蓝问号，危险操作（删除 / 封账）换红色感叹号 */
.cfd-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-weight: 800;
  color: #4f46e5;
  background: #eef2ff;
}
/* 图标四种：info 靛蓝 i（一般确认）/ warn 琥珀 !（有风险但能做）/ error 红 !（删了拿不回来）/ ok 绿 ✓（提示成功） */
.cfd-icon { color: #4f46e5; background: #eef2ff; }
.cfd-icon-info  { color: #4f46e5; background: #eef2ff; }
.cfd-icon-warn  { color: #b45309; background: #fffbeb; }
.cfd-icon-error { color: #dc2626; background: #fef2f2; }
.cfd-icon-ok    { color: #047857; background: #ecfdf5; }

.cfd-msg {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;   /* JS 传进来的 \n 按换行显示 */
  word-break: break-word;
}

.cfd-btns { display: flex; gap: 10px; margin-top: 20px; }
.cfd-btns .btn {
  flex: 1 1 0;
  justify-content: center;
  margin: 0;
  padding: 10px 0;
  font-size: 14px;
}
.cfd-btns .btn[hidden] { display: none; }   /* 提示框（uiAlert）只有一个按钮 */
/* 默认的系统蓝焦点圈在红 / 琥珀键上很扎眼，换成浅灰描边（键盘可达性保留） */
.cfd-btns .btn:focus { outline: 2px solid rgba(148, 163, 184, .55); outline-offset: 2px; }
/* 确定键：靛蓝主色；危险操作换红。写在 body .cfd-btns 下是为了压过
   body.scope-admin .btn（同样特异性但靠后定义者胜），否则后台里确定键会被染回 indigo */
body .cfd-btns .cfd-ok { background: #4f46e5; border-color: #4f46e5; color: #fff; }
body .cfd-btns .cfd-ok:hover { background: #4338ca; border-color: #4338ca; color: #fff; }
body .cfd-btns .cfd-ok.cfd-ok-danger { background: #dc2626; border-color: #dc2626; }
body .cfd-btns .cfd-ok.cfd-ok-danger:hover { background: #b91c1c; border-color: #b91c1c; }
body .cfd-btns .cfd-ok.cfd-ok-warn { background: #d97706; border-color: #d97706; }
body .cfd-btns .cfd-ok.cfd-ok-warn:hover { background: #b45309; border-color: #b45309; }

/* 手机上别顶满全屏，贴底部更好按 */
@media (max-width: 560px) {
  .cfd-mask { padding: 16px; align-items: flex-end; }
  .cfd-card { border-radius: 18px 18px 14px 14px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

/* ---------- 后台：更新日志（只展示最近两个版本） ---------- */
/* 全是文字，别拉满后台那 1680px 的宽屏，行太长反而难读 */
.upd-card { max-width: 820px; }
.upd-body { display: flex; flex-direction: column; gap: 14px; }

.upd-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 16px 18px;
}
/* 最新那版提亮一档，一眼看出哪个是刚更新的 */
.upd-item-new {
  background: var(--card);
  border-color: #dbeafe;
  box-shadow: 0 1px 2px rgba(59, 130, 246, .08);
}

.upd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.upd-ver {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.upd-date { font-size: 13px; color: var(--muted); }
.upd-new {
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 1px 9px;
}

.upd-sub {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  margin: 8px 0 10px;
}
.upd-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upd-points li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.upd-points li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #93c5fd;
}

@media (max-width: 560px) {
  .upd-item { padding: 14px; }
  .upd-ver { font-size: 15px; }
  .upd-points li { font-size: 14px; }
}

/* ============================================================
   榜单激励（后台配置页 + 报单人端榜单）
   ============================================================ */

/* ---------- 报单人端：我的名次卡 ---------- */
.rank-me { position: relative; }
/* 上榜才铺渐变底；榜外保持白卡，别让人误以为上榜了 */
.rank-me-intop {
  color: #fff;
  border-color: transparent;
  background-image: var(--grad-b);
  box-shadow: 0 10px 30px -18px rgba(236, 72, 153, .75);
}
.rank-me-label { font-size: 13px; color: var(--muted); }
.rank-me-intop .rank-me-label { color: #fff; opacity: .88; }
.rank-me-rank {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.rank-me-rank b {
  margin: 0 2px;
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 600;
}
.rank-me-none { font-size: 24px; color: var(--text-2); }
.rank-me-sub { font-size: 14px; color: var(--text-2); }
.rank-me-sub b { font-family: var(--mono); font-size: 17px; color: var(--text); }
.rank-me-intop .rank-me-sub,
.rank-me-intop .rank-me-sub b { color: #fff; }
.rank-me-intop .rank-me-sub { opacity: .92; }
.rank-me-prize {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  font-size: 14px;
  font-weight: 500;
}

/* ---------- 报单人端：排行榜 ---------- */
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.rank-item:hover { transform: translateY(-2px); border-color: var(--line-2); }
.rank-item-me { background: #eff6ff; border-color: #bfdbfe; }
.rank-who {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-item-me .rank-who { font-weight: 600; }
.rank-me-tag {
  font-style: normal;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--focus);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1.5px;
}
.rank-cnt { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.rank-cnt b { font-family: var(--mono); font-size: 17px; color: var(--text); }
.rank-prize {
  padding: 3px 10px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  font-size: 13px;
  white-space: nowrap;
}
.rank-foot { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }

/* 名次徽标：前三名金银铜 */
.rank-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.rank-no-1 { background-image: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
.rank-no-2 { background-image: linear-gradient(135deg, #cbd5e1, #64748b); color: #fff; }
.rank-no-3 { background-image: linear-gradient(135deg, #e0a06a, #9a5b32); color: #fff; }

/* ---------- 报单人端：奖励领取 ---------- */
.claim-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.claim-pz { font-size: 18px; font-weight: 600; }
.claim-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--soft);
  color: var(--text-2);
}
.claim-open    { background: #e8f5e9; color: #1b7f3b; }
.claim-pending { background: #fff6e5; color: #97600a; }
.claim-approved{ background: #e7f0ff; color: #1c5fb0; }
.claim-paid    { background: #e8f5e9; color: #1b7f3b; }
.claim-rejected{ background: #fdeaea; color: #b4232a; }
.claim-over    { background: var(--soft); color: var(--muted); }
.claim-meta { margin-top: 8px; font-size: 13.5px; color: var(--text-2); }
.claim-reason {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fdeaea;
  color: #b4232a;
  font-size: 13.5px;
}
.claim-acts { margin-top: 14px; }

/* 报单人端：站内消息 */
.notice-card .notice-item + .notice-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.notice-hd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.notice-t { font-size: 15px; font-weight: 600; }
.notice-time { font-size: 12.5px; color: var(--muted); }
.notice-body { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.notice-acts { margin-top: 14px; }

/* ---------- 后台：奖励领取记录 ---------- */
/* 筛选行：三个条件等宽，按钮与输入框底部对齐。
   两个坑：① .field 自带 16px 下外边距，而 flex-end 是按「外边距盒」对齐的，
   按钮会被白白压低一截，跟输入框错位 —— 必须把外边距清掉；
   ② <a> 和 <button> 写成同一种按钮时高度仍会差几像素，给个定高才齐。 */
.claim-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.claim-filter .field { flex: 0 0 160px; margin-bottom: 0; }
/* 两个按钮包成一组：换行时整组一起走下去，不会「筛选」留在上一行、「重置」被甩到下一行 */
.claim-filter-acts { display: flex; gap: 10px; align-items: flex-end; margin-left: 8px; }
.claim-filter-acts .btn {
  height: 40px;                    /* 与输入框同高 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}
.claim-batch { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.claim-detail { margin: 0; padding: 12px 0 0; }
.claim-detail div { display: flex; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.claim-detail dt { width: 88px; flex: 0 0 auto; color: var(--muted); }
.claim-detail dd { margin: 0; color: var(--text); }

/* ---------- 后台：奖励配置表 ---------- */
.rank-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 22px 0 10px; }
.rank-head-t { font-size: 15px; font-weight: 600; }
.rank-rw-table .input { width: 100%; max-width: none; }
.rank-rw-table td { padding: 8px 10px; }
.rw-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

@media (max-width: 560px) {
  .rank-me-rank b { font-size: 34px; }
  .rank-item { flex-wrap: wrap; gap: 8px 10px; }
  .rank-prize { flex-basis: 100%; text-align: center; }
  .rank-head { margin-top: 18px; }
  /* 窄屏：条件框随宽度伸缩换行，别死守 168px 挤成三行 */
  .claim-filter .field { flex: 1 1 140px; }
  .claim-filter-acts { margin-left: 0; }
}

/* ---------- 备注快捷扣减（查单对账：原因 − 金额 [插入]） ----------
   放在文件末尾压过后台 .input 基础样式与卡片模式的覆盖。
   关键点：不写死 height，用 padding 把输入框撑起来——部分内核对设了 height
   的输入框会把文字顶到上沿（用户实测金额框文字跑到了顶部），
   靠内容自然撑高的输入框文字永远垂直居中。 */
.rmk-qd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}
body.scope-admin .rmk-qd .rmk-qd-label,
body.scope-admin .rmk-qd .rmk-qd-amt {
  height: auto;
  min-height: 0;
  width: auto;
  padding: 6px 9px;
  font-size: 12.5px;
  line-height: 1.4;
}
body.scope-admin .rmk-qd .rmk-qd-label { flex: 1 1 90px; min-width: 70px; }
/* min-width:0 必须有：输入框的默认最小内容宽度约 159px，不加这条金额框会被撑到 159px，
   把整行挤成竖排（备注列本来就只有 170px 宽） */
body.scope-admin .rmk-qd .rmk-qd-amt { flex: 0 1 72px; width: 72px; min-width: 0; text-align: right; }
body.scope-admin .rmk-qd .rmk-qd-sep { flex: none; font-weight: 700; color: var(--muted); }
body.scope-admin .rmk-qd .rmk-qd-cap { flex: none; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
/* 「− 金额 输入框 插入」捆成一个不可拆组：备注列太窄要折行时，整组一起掉到第二行，
   不会出现「− 金额」留在上一行、输入框孤零零掉下来的情况 */
body.scope-admin .rmk-qd .rmk-qd-g {
  display: inline-flex;
  flex: none;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
}
body.scope-admin .rmk-qd .rmk-qd-add {
  flex: none;
  height: auto;
  min-height: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 12.5px;
}
/* 卡片模式（≤720px）会把 td 里的输入框放大（min-height 38 + 宽度 !important 拉满），
   这里按同权重改回来，三个控件保持紧凑 */
@media (max-width: 720px) {
  body.scope-admin .card-table td .rmk-qd-label,
  body.scope-admin .card-table td .rmk-qd-amt {
    width: auto !important;
    min-height: 0;
    height: auto;
    padding: 7px 9px;
    font-size: 12.5px;
    line-height: 1.4;
  }
  body.scope-admin .card-table td .rmk-qd-amt { flex: 0 1 72px; width: 72px !important; min-width: 0; }
  body.scope-admin .card-table td .rmk-qd-add { min-height: 0; }
}
