:root {
  --bg: #f5f6f8;
  --panel: #fff;
  --panel-2: #fafafa;
  --text: #1f2937;
  --text-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #9ca3af;
  --input-border: #d1d5db;
  --sidebar: #1f2937;
  --primary: #2563eb;
  --primary-soft: #eff4ff;
  --primary-line: #bfdbfe;
  --primary-text: #1e40af;
  --green: #059669;
  --green-soft: #ecfdf5;
  --orange: #d97706;
  --orange-soft: #fff7ed;
  --orange-faint: #fffdf8;
  --orange-line: #fed7aa;
  --orange-text: #9a3412;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-line: #fecaca;
  --gray-soft: #f3f4f6;
  --radius: 0; /* XY-151：全站直角 */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --panel: #181b21;
    --panel-2: #1d2027;
    --text: #e5e7eb;
    --text-2: #cbd0d8;
    --muted: #9097a3;
    --line: #2a2e36;
    --line-strong: #4b515c;
    --input-border: #353a44;
    --sidebar: #12141a;
    --primary: #3b82f6;
    --primary-soft: #1a2540;
    --primary-line: #2f4a80;
    --primary-text: #a9c4ff;
    --green: #10b981;
    --green-soft: #12291f;
    --orange: #f59e0b;
    --orange-soft: #2c2010;
    --orange-faint: #1f1b14;
    --orange-line: #6b4a17;
    --orange-text: #fcd28d;
    --red: #f05252;
    --red-soft: #2e1616;
    --red-line: #6b2222;
    --gray-soft: #22262e;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115;
  --panel: #181b21;
  --panel-2: #1d2027;
  --text: #e5e7eb;
  --text-2: #cbd0d8;
  --muted: #9097a3;
  --line: #2a2e36;
  --line-strong: #4b515c;
  --input-border: #353a44;
  --sidebar: #12141a;
  --primary: #3b82f6;
  --primary-soft: #1a2540;
  --primary-line: #2f4a80;
  --primary-text: #a9c4ff;
  --green: #10b981;
  --green-soft: #12291f;
  --orange: #f59e0b;
  --orange-soft: #2c2010;
  --orange-faint: #1f1b14;
  --orange-line: #6b4a17;
  --orange-text: #fcd28d;
  --red: #f05252;
  --red-soft: #2e1616;
  --red-line: #6b2222;
  --gray-soft: #22262e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; overscroll-behavior: none; }
.layout, .sidebar, .nav, .main { overscroll-behavior: none; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
input, select, textarea, button { font: inherit; color: inherit; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
/* XY-170：侧栏略收窄；XY-172：主栏统一约首页宽，宽屏留白勿拉满 viewport */
/* XY-171：工具栏控件统一高度（搜索/筛选/日期/按钮同行对齐） */
:root { --sidebar-w: 176px; --main-max: 800px; --ctrl-h: 34px; }
/* z-index：侧栏浮层要压住主栏，否则「在手机上登陆」侧向浮窗会被主内容盖住 */
.sidebar { width: var(--sidebar-w); background: var(--sidebar); color: #d1d5db; flex-shrink: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 20; }
.brand { font-weight: 700; font-size: 18px; color: #fff; padding: 18px 16px; letter-spacing: 1px; }
/* XY-153：选中/悬停高亮拉满侧栏宽，左右无内缩 */
.nav { flex: 1; overflow-y: auto; padding: 4px 0; }
.nav a { display: flex; align-items: center; color: #d1d5db; padding: 9px 16px; border-radius: 0; margin-bottom: 0; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.active { background: #374151; color: #fff; }
.nav .sep { height: 1px; background: #374151; margin: 8px 0; }
.userbox { padding: 10px 8px; border-top: 1px solid #374151; font-size: 13px; flex-shrink: 0; }
.userbox .name { color: #fff; font-weight: 600; }
.userbox a { color: #9ca3af; margin-right: 12px; }
/* 账号选单侧向浮窗：在手机上登陆 / 切换人员视角 共用 .um-float（即时显隐、同款面板） */
.um-float {
  position: absolute; z-index: 960;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: none;
  transition: none !important; animation: none !important;
}
.tm-viewas { position: relative; }
.tm-viewas-btn { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: var(--text-2); padding: 7px 8px; border-radius: var(--radius); cursor: pointer; font-size: 13px; text-align: left; }
.tm-viewas-btn:hover, .tm-viewas.open .tm-viewas-btn { background: var(--gray-soft); color: var(--text); }
.tm-viewas-btn .ic { width: 18px; height: 18px; color: var(--muted); }
.tm-viewas-pop {
  left: calc(100% + 6px); bottom: 0;
  min-width: 180px; max-width: 240px; max-height: min(280px, 46vh); overflow-y: auto; padding: 4px;
}
/* XY-190：桥接触发器与侧向浮窗的空隙，避免 pointerleave 误关 */
.tm-viewas-pop::before {
  content: '';
  position: absolute;
  left: -10px; top: 0; bottom: 0; width: 10px;
}
.viewas-item {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none;
  color: var(--text-2); padding: 6px 8px; border-radius: var(--radius); cursor: pointer; font: inherit; font-size: 13px; text-align: left;
}
.viewas-item:hover { background: var(--gray-soft); color: var(--text); }
.viewas-item-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewas-empty { padding: 10px 8px; font-size: 12px; }
@media (max-width: 700px) {
  .tm-viewas-pop { left: 0; right: 0; bottom: calc(100% + 4px); max-width: none; }
}
/* flex-grow 吃剩余宽，但 max-width 卡住内容柱；右侧自然留白 */
.main {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: var(--main-max);
  padding: 24px 28px 60px;
  box-sizing: border-box;
}
.topbar { display: none; }
/* 各主内容页标题统一槽位：同一起点、同一行高，旁侧控件不挤偏标题 */
.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  min-height: 32px;
}
.page-head > h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 32px;
  margin: 0;
  flex: 0 0 auto;
}
.page-head > .back-link {
  line-height: 32px;
  min-height: 32px;
}
.page-head .spacer { flex: 1; min-width: 8px; }

.nav-backdrop { display: none; }
@media (max-width: 800px) {
  .layout { display: block; }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, .35);
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  /*
   * 侧栏贴底：勿用 height:100vh（Android Chrome 大视口常含底栏后区域，
   * 底栏展开时像「收起导航才贴底」）。改用 fixed + top/bottom:0 锚定可视上下沿，
   * safe-area 留给顶/账号区；dvh 仅作可选上限，避免随 chrome 跳动绑死高度。
   */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    width: 230px;
    height: auto; /* 清掉桌面 sticky 的 100vh，改由 top/bottom 撑满 */
    transform: translateX(-100%);
    transition: transform .12s ease;
    padding-top: env(safe-area-inset-top, 0px);
    box-sizing: border-box;
  }
  .sidebar.open { transform: none; }
  .sidebar .nav { min-height: 0; -webkit-overflow-scrolling: touch; }
  /* 账号入口贴侧栏底：安全区 + 少量呼吸（不依赖浏览器底栏收起） */
  .userbox {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  /* 侧栏打开：锁背后页面滚动（仅移动端生效）；侧栏 .nav 仍可滚 */
  html.nav-open,
  html.nav-open body {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }
  html.nav-open body {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
  }
  html.nav-open .sidebar,
  html.nav-open .sidebar .nav {
    touch-action: pan-y;
  }
  html.nav-open .nav-backdrop {
    touch-action: manipulation;
  }
  .topbar { display: flex; align-items: center; gap: 10px; background: var(--sidebar); color: #fff; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; padding: 0 4px; flex-shrink: 0; }
  /* XY-120/132：页内标题区可见时顶栏不叠字；多级回退用 page-head back-link（箭头+短父级） */
  .topbar .t { font-weight: 600; opacity: 0; transition: opacity .15s ease; pointer-events: none; }
  .topbar .t.on { opacity: 1; }
  .main { padding: 14px 12px 60px; padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .hide-m { display: none !important; }
}

/* 通用组件 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.tight { padding: 12px 14px; }
.grid { display: grid; gap: 12px; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .v { font-size: 24px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; }
a.stat { color: inherit; }
a.stat:hover { border-color: var(--line-strong); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); padding: 7px 14px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; color: var(--text); }
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.lg { padding: 11px 18px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap > .input { padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; background: none;
  color: var(--muted); cursor: pointer; border-radius: var(--radius);
}
.pw-toggle:hover { color: var(--text); background: var(--gray-soft); }
.pw-toggle .ic { width: 20px; height: 20px; }
.login-forgot { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.login-forgot .link-btn { font-size: 13px; }
.login .label-row label { margin: 0; }
.login-err { color: var(--red); font-size: 12px; font-weight: 500; line-height: 1.2; text-align: right; max-width: 65%; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--input-border); border-radius: var(--radius); padding: 8px 10px; background: var(--panel); }
.input:focus { outline: 2px solid var(--primary-line); border-color: var(--primary); }
textarea.input { min-height: 80px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border: 1px solid var(--line); background: var(--panel); padding: 5px 12px; border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
/* 目标商品列表：紧凑状态分段 + 独立「我的」 */
.lead-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.seg-control { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.seg-control button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; padding: 4px 9px; cursor: pointer; line-height: 1.35; }
.seg-control button + button { border-left: 1px solid var(--line); }
.seg-control button:hover:not(.on) { color: var(--text-2); }
.seg-control button.on { color: var(--text); background: var(--gray-soft); font-weight: 600; }
.seg-control button.soft:not(.on) { color: #b0b6be; }
.filter-toggle { border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: inherit; font-size: 12px; padding: 4px 10px; border-radius: var(--radius); cursor: pointer; line-height: 1.35; }
.filter-toggle:hover:not(.on) { color: var(--text-2); border-color: var(--line-strong); }
.filter-toggle.on { color: var(--text); border-color: var(--text); background: var(--gray-soft); font-weight: 600; }
.lead-adv-wrap { position: relative; display: inline-flex; align-items: center; margin-left: 2px; }
.lead-adv-btn.on { color: var(--text); background: var(--gray-soft); }
.lead-adv-btn.active { color: var(--primary); background: var(--primary-soft); }
.lead-adv-btn.active:hover { color: var(--primary-text); background: var(--primary-soft); }
.lead-adv-pop {
  right: 0; left: auto; top: calc(100% + 6px);
  width: min(320px, 92vw); padding: 12px 12px 10px;
  display: flex; flex-direction: column; gap: 12px; z-index: 40;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.lead-adv-field { display: flex; flex-direction: column; gap: 8px; }
.lead-adv-field + .lead-adv-field { padding-top: 10px; border-top: 1px solid var(--line); }
.lead-adv-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.lead-adv-pop .people-grid { gap: 8px 6px; }
.lead-adv-clear {
  width: 100%; margin-top: 2px; padding: 8px 12px; font-size: 13px; font-weight: 600;
  border-radius: var(--radius); border-color: var(--line-strong); background: var(--gray-soft);
}
.lead-adv-clear:hover { border-color: var(--text); background: var(--panel-2); }
.person.dim, .person:disabled { opacity: .38; cursor: default; color: var(--muted); }
.person.dim:hover, .person:disabled:hover { color: var(--muted); }
.person.dim:hover .person-ava, .person:disabled:hover .person-ava { box-shadow: none; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar .input { width: auto; flex: 1; min-width: 160px; }

/* XY-171：同行搜索/筛选/日期/按钮同高 */
.toolbar .input:not(textarea),
.toolbar select.input,
.stock-toolbar .input:not(textarea),
.stock-toolbar select.input,
.filters .input:not(textarea),
.filters select.input {
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  max-height: var(--ctrl-h);
  padding-top: 0;
  padding-bottom: 0;
  line-height: calc(var(--ctrl-h) - 2px);
  box-sizing: border-box;
  font-size: 13px;
}
.toolbar select.input,
.stock-toolbar select.input,
.filters select.input {
  /* select 在部分内核上 line-height 不居中，靠固定高 + 左右内边距对齐 */
  padding-left: 8px;
  padding-right: 24px;
}
.toolbar input[type="date"].input,
.stock-toolbar input[type="date"].input,
.filters input[type="date"].input {
  flex: 0 0 auto;
  width: auto;
  min-width: 9.6em;
  max-width: 11em;
  /* 系统 date 控件易偏高，压进统一槽位 */
  appearance: none;
  -webkit-appearance: none;
}
.toolbar input[type="date"].input::-webkit-calendar-picker-indicator,
.stock-toolbar input[type="date"].input::-webkit-calendar-picker-indicator,
.filters input[type="date"].input::-webkit-calendar-picker-indicator {
  margin: 0; opacity: .55; cursor: pointer;
}
.toolbar > .btn:not(.sm):not(.lg),
.stock-toolbar > .btn:not(.sm):not(.lg),
.filters > .btn:not(.sm):not(.lg) {
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
  box-sizing: border-box;
  font-size: 13px;
}

.badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius); font-size: 12px; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.badge.quiet { background: transparent; border: 1px solid var(--line); color: var(--text-2); border-radius: var(--radius); padding: 0 6px; font-weight: 500; }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }

/* 仓库：类型筛选为主，少胶囊 */
.stock-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.stock-toolbar .stock-kind { flex: 0 1 148px; min-width: 120px; max-width: 180px; font-weight: 600; }
.stock-toolbar .stock-q { flex: 1 1 180px; min-width: 140px; }
.stock-toolbar .stock-status { flex: 0 1 132px; min-width: 110px; max-width: 160px; }
.stock-toolbar > .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .stock-toolbar .stock-kind, .stock-toolbar .stock-status { flex: 1 1 calc(50% - 4px); }
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.price { font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.pre { white-space: pre-wrap; word-break: break-word; }

table.t { width: 100%; border-collapse: collapse; background: var(--panel); }
table.t th, table.t td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }

/* 列表卡片 */
.list-item { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; color: inherit; }
a.list-item:hover { border-color: var(--line-strong); }
.list-item .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-item .title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.list-item.locked { border-left: 4px solid var(--orange); background: var(--orange-faint); }
.list-item.masked { color: var(--muted); background: var(--panel-2); }
.specs { font-size: 13px; margin-top: 6px; color: var(--text-2); }
.specs span + span::before { content: " · "; color: #9ca3af; }

.lock-banner { background: var(--orange-soft); border: 1px solid var(--orange-line); color: var(--orange-text); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-weight: 600; }
.lock-banner.mine { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-text); }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs .th { position: relative; width: 84px; height: 84px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--gray-soft); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.thumbs .th .x { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: var(--radius); width: 20px; height: 20px; line-height: 18px; cursor: pointer; }
.thumbs .add { width: 84px; height: 84px; border: 1px dashed var(--line-strong); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; font-size: 26px; }

.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; }
.kv .k { color: var(--muted); }

.parts-edit .prow { display: grid; grid-template-columns: 108px 1fr 60px 1fr 30px; gap: 8px; align-items: start; margin-bottom: 8px; }
.parts-edit .cat { font-weight: 600; font-size: 13px; white-space: nowrap; padding-top: 8px; }
.parts-edit.priced .prow { grid-template-columns: 108px 1fr 60px 110px 1fr 30px; }
.parts-edit .price-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.parts-edit.config-edit .prow { grid-template-columns: 108px 1fr 1fr 30px; }
.config-view { display: flex; flex-direction: column; gap: 6px; }
.config-row { display: grid; grid-template-columns: 88px 1fr; gap: 8px 12px; align-items: baseline; font-size: 14px; line-height: 1.45; }
.config-row .config-cat { color: var(--muted); font-weight: 600; font-size: 13px; }
.config-row .config-note { grid-column: 2; font-size: 13px; }
.parts-total { text-align: right; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.price-hint { font-size: 11px; line-height: 1.3; margin-top: 2px; }
@media (max-width: 700px) {
  .parts-edit .prow, .parts-edit.priced .prow { grid-template-columns: 1fr 56px 30px; background: var(--panel-2); padding: 8px; border-radius: var(--radius); align-items: center; }
  .parts-edit.config-edit .prow { grid-template-columns: 1fr 30px; }
  .parts-edit .cat { grid-column: 1 / -1; padding-top: 0; }
  .parts-edit .pnote, .parts-edit .price-cell { grid-column: 1 / -1; }
}

/* 权限选单：模板在上、按业务域分组；单行勾选，说明放悬停 tip */
.perm-picker { display: flex; flex-direction: column; gap: 14px; }
.perm-presets-h, .perm-group-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.perm-presets-h .muted, .perm-group-h .muted { font-weight: 500; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font: inherit; font-size: 12px; line-height: 1.2; padding: 5px 10px; border-radius: var(--radius); cursor: pointer; }
.perm-chip:hover { color: var(--text); border-color: var(--line-strong); }
.perm-chip.on { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.perm-chip.quiet { color: var(--muted); }
.perm-chip:disabled { opacity: .4; cursor: default; }
.perm-groups { display: flex; flex-direction: column; gap: 10px; }
.perm-group + .perm-group { padding-top: 10px; border-top: 1px solid var(--line); }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 1px 8px; }
.perm-item { display: flex; align-items: center; gap: 7px; margin: 0; padding: 5px 4px; border-radius: var(--radius); cursor: pointer; font-weight: normal; color: var(--text-2); }
.perm-item:hover { background: var(--gray-soft); color: var(--text); }
.perm-item.on { color: var(--text); }
.perm-item input { margin: 0; flex-shrink: 0; }
.perm-item-text { min-width: 0; }
.perm-item-label { font-size: 13px; line-height: 1.25; }
.perm-item[data-tip]::after { white-space: normal; max-width: 220px; text-align: left; left: 0; transform: none; }
/* XY-179：超管模板 — 全勾标灰不可改 */
.perm-item.locked,
.perm-item:has(input:disabled) {
  opacity: .55; cursor: default; color: var(--muted);
}
.perm-item.locked:hover,
.perm-item:has(input:disabled):hover { background: transparent; color: var(--muted); }
.perm-picker.locked .perm-item.on { color: var(--muted); }
@media (max-width: 560px) { .perm-list { grid-template-columns: 1fr; } }

/* 弹窗与提示 */
.modal-mask { position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); color: var(--text); border-radius: var(--radius); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 20px; }
.modal.wide { max-width: 760px; }
.modal h2 { margin-bottom: 10px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal.warn { border-top: 6px solid var(--red); }
.modal.warn .big { font-size: 17px; font-weight: 700; color: var(--red); margin-bottom: 8px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; max-width: min(360px, calc(100vw - 32px)); }
.toast { pointer-events: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-left: 3px solid var(--text-2); box-shadow: 0 4px 14px rgba(0,0,0,.08); padding: 7px 12px; font-size: 13px; line-height: 1.4; display: flex; align-items: center; gap: 12px; }
.toast.err { border-left-color: var(--red); }
.toast.err span { color: var(--red); }
.toast-act { background: none; border: 0; color: var(--blue, #2563eb); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.toast-act:hover { text-decoration: underline; }
@media (max-width: 760px) { .toasts { left: 16px; right: 16px; align-items: stretch; max-width: none; } }
/* 按钮旁的小浮窗确认 / 表单（不盖住整页） */
.pop-mask { position: fixed; inset: 0; z-index: 100; }
.pop-dialog { position: fixed; visibility: hidden; width: 300px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 10px 12px; }
.pop-dialog.pop-form { width: 340px; }
.pop-dialog h2 { font-size: 14px; margin: 0 0 6px; }
.pop-dialog p, .pop-dialog .pre { font-size: 13px; color: var(--text-2); margin: 0 0 8px; }
.pop-dialog .big { font-size: 18px; font-weight: 600; margin: 4px 0 8px; }
.pop-dialog .field { margin-bottom: 8px; }
.pop-dialog .foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.pop-dialog .foot .btn { min-height: 28px; padding: 0 10px; font-size: 13px; }
.pop-dialog textarea.input { min-height: 52px; }
.img-view { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 150; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.img-view img { max-width: 95vw; max-height: 95vh; }
.qr-box { text-align: center; }
.qr-box img { width: 260px; max-width: 100%; }

/* 目标商品：详情分层布局（非卡片墙）；XY-175 已去掉谈判/检视 mode-switch */
.lead-detail { max-width: none; }
.lead-detail .page-head { position: relative; gap: 8px; }
.lead-layout { display: flex; gap: 28px; align-items: flex-start; }
.lead-col { flex: 1; min-width: 0; }
.lead-band { padding: 14px 0; border-bottom: 1px solid var(--line); }
.lead-band:last-child { border-bottom: 0; }
.lead-h { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: none; }
.lead-h .muted { font-weight: 500; letter-spacing: 0; }
.lead-h-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.lead-h-row .lead-h { margin: 0; }
.lead-id-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
button.lead-code { font-size: 15px; font-weight: 600; color: var(--text-2); background: none; border: 0; padding: 0; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
button.lead-code:hover { color: var(--text); }
.lead-price { font-size: 20px; font-weight: 700; }
.lead-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.lead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.lead-meta a { color: var(--primary-text); }
.lead-uploader { display: inline-flex; line-height: 0; border-radius: 50%; }
.lead-link-row { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.lead-url { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-link-row .link-btn { flex-shrink: 0; font-size: 13px; color: var(--muted); }
.lead-link-row .link-btn:hover { color: var(--primary-text); }
/* 桌面：宽屏 QR 侧栏；窄桌面用链接区 inline；谈判自动展示 / 检视留白 */
.lead-qr-aside { flex: 0 0 200px; position: sticky; top: 12px; }
.lead-qr-panel-inline { display: none; margin-top: 12px; }
.lead-qr-inline { display: flex; align-items: center; gap: 14px; padding: 4px 0 0; }
.lead-qr-inline.stacked { flex-direction: column; align-items: flex-start; gap: 10px; }
.lead-qr-inline img {
  width: 180px; height: 180px; flex-shrink: 0;
  image-rendering: pixelated; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.lead-qr-panel-inline .lead-qr-inline img { width: 160px; height: 160px; }
.lead-qr-caption { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.lead-qr-caption p { margin: 0; }
.lead-qr-caption .btn .ic { width: 14px; height: 14px; }
.lead-qr-slot {
  display: block; width: 180px; height: 180px; padding: 0;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: transparent; cursor: pointer;
}
.lead-qr-slot.sm { width: 160px; height: 160px; }
.lead-qr-slot:hover:not(:disabled) { border-color: var(--line-strong); background: var(--gray-soft); }
.lead-qr-slot:disabled { cursor: wait; opacity: .7; }
.lead-lock-line {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--primary-text);
}
.lead-lock-line.other { color: var(--orange-text); }
.lead-lock-line .ic { width: 14px; height: 14px; }
.lead-ops { margin: 0; }
.lead-result-note, .lead-unqual-body { margin: 8px 0 0; font-size: 14px; color: var(--text-2); white-space: pre-wrap; line-height: 1.5; }
.lead-unqual .lead-unqual-body { margin-top: 0; }
.lead-admin-empty { margin: 0; }
.lead-more-toggle {
  display: inline-flex; align-items: baseline; gap: 8px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2);
}
.lead-more-toggle:hover { color: var(--text); }
.lead-more-body { margin-top: 10px; }
.lead-more-block + .lead-more-block { margin-top: 14px; }
.lead-band .pre { margin: 0; font-size: 14px; line-height: 1.55; }
.list-item .meta .avatar { vertical-align: -4px; margin-right: 2px; }
.list-item .lead-unqual-reason { color: var(--text-2); max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) {
  .lead-qr-aside { display: none; }
  .lead-qr-panel-inline { display: block; }
}
@media (max-width: 700px) {
  .lead-layout { display: block; }
  .lead-band { padding: 12px 0; }
  .lead-price { font-size: 18px; }
  .lead-title { font-size: 16px; }
}

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-logo { width: 26px; height: 26px; }
/* XY-210/211：快捷/手动固定同宽同高；setup 可增高 */
.login {
  /* 高度按账号密码表单刚好放下定（约 304），快捷登录同高，两种模式按钮同位 */
  width: 360px; max-width: 100%; min-height: 304px;
  display: flex; flex-direction: column; box-sizing: border-box;
}
.login.login-setup { height: auto; min-height: 304px; }
.login .brand {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  color: var(--text); padding: 0 0 10px; font-size: 24px; font-weight: 700;
}
.login-main {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
/* 账号密码与快捷登录：登录按钮都贴在卡片底部同一位置 */
.login-submit { width: 100%; margin-top: auto; }
/* 账号密码两栏在标题与按钮之间居中（与按钮的 auto 平分空白），不改卡片高度 */
.login:not(.login-setup) .login-main > .field:first-child { margin-top: auto; }

.hist { font-size: 13px; }
.hist .h { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hist .h:last-child { border-bottom: 0; }
.chg { font-size: 12px; color: var(--muted); margin-top: 3px; }
/* XY-168：改数字不用红绿强调，中性色 */
.chg del { color: var(--muted); text-decoration: line-through; opacity: .85; }
.chg ins { color: var(--text-2); text-decoration: none; }
.chg-batch { margin-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.chg-batch-item {
  padding: 4px 0 4px 8px;
  border-left: 2px solid var(--line);
  font-size: 12px; color: var(--text-2);
}
.chg-batch-item .chg { margin-top: 2px; }

.combo { position: relative; }
.combo .input { padding-right: 28px; }
.combo .caret { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); cursor: pointer; font-size: 12px; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); background: var(--panel); border: 1px solid var(--input-border); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto; z-index: 30; }
.combo-list .opt { padding: 7px 10px; cursor: pointer; font-size: 13px; line-height: 1.35; }
.combo-list .opt:hover, .combo-list .opt.hi { background: var(--gray-soft); }
.combo-list .opt.hi { outline: none; }

.ic { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; vertical-align: middle; }
.tm-mask { position: fixed; inset: 0; z-index: 940; }
/* XY-187：浮窗菜单打开时锁背后页面滚动（与侧栏 nav-open 同手法） */
html.float-open,
html.float-open body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
html.float-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}
html.float-open .um-float,
html.float-open .tm-list,
html.float-open .avatar-pop,
html.float-open .staff-more-pop,
html.float-open .modal {
  touch-action: pan-y;
}
.tm-list { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 950; min-width: 160px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 4px; }
.tm-list button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: var(--text-2); padding: 7px 8px; border-radius: var(--radius); cursor: pointer; font-size: 13px; text-align: left; }
.tm-list button:hover { background: var(--gray-soft); }
.tm-list button.on { color: var(--text); font-weight: 600; }
.tm-list button span { flex: 1; }
.tm-list .ic { width: 18px; height: 18px; color: var(--muted); }
.user-menu { position: relative; }
.user-menu.open { z-index: 950; }
.um-trigger { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 6px 10px; border-radius: var(--radius); cursor: pointer; color: inherit; text-align: left; }
.um-trigger:hover { background: #374151; }
.um-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.um-trigger .name { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-trigger .um-super { flex-shrink: 0; } /* 与我的账号 id 旁 .role-ic 同色同图标 */
.um-sub { font-size: 11px; color: #fbbf24; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 32px; }
.view-switch button { border: 0; background: var(--panel); color: var(--text); padding: 0 14px; height: 32px; line-height: 30px; cursor: pointer; }
.view-switch button.on { background: var(--gray-soft); color: var(--text); font-weight: 600; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-bottom: 12px; }
/* XY-171：只收左右内边距，高度交给 --ctrl-h，避免与工具栏同高规则打架 */
.filters .input { padding-left: 8px; padding-right: 8px; }
.result-count-row { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; min-height: 24px; }
.result-count { color: var(--muted); font-size: 13px; margin: 0; }
.sort-wrap { position: relative; display: inline-flex; }
.sort-btn.on { color: var(--text); background: var(--gray-soft); }
.sort-pop { left: 0; top: calc(100% + 4px); min-width: 148px; padding: 4px; display: flex; flex-direction: column; gap: 1px; }
.sort-pop button { border: 0; background: transparent; text-align: left; font: inherit; font-size: 13px; color: var(--text-2); padding: 7px 10px; border-radius: var(--radius); cursor: pointer; line-height: 1.3; }
.sort-pop button:hover { background: var(--gray-soft); color: var(--text); }
.sort-pop button.on { color: var(--text); font-weight: 600; background: var(--gray-soft); }
.viewas-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--orange-soft); border: 1px solid var(--orange-line); color: var(--orange-text); padding: 8px 12px; border-radius: var(--radius); margin-bottom: 14px; }
.viewas-bar .btn { margin-left: auto; }
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #f0f0f0; display: block; }
.avatar-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-opt { border: 2px solid transparent; border-radius: 50%; padding: 2px; background: none; cursor: pointer; }
.avatar-opt:hover { border-color: var(--line-strong); }
.avatar-opt.on { border-color: var(--accent, #2563eb); }
/* XY-208：引导面板无品牌；标题即「首次登录设置（x/3）」 */
/* XY-219：「下一步」/「完成」贴面板底 */
.login.onboard { display: flex; flex-direction: column; }
.onboard-title {
  margin: 0 0 12px; font-size: 20px; font-weight: 650; line-height: 1.3; color: var(--text);
  flex-shrink: 0;
}
.onboard-steps {
  display: flex; gap: 8px; margin: 0 0 14px; font-size: 12px; color: var(--muted);
  flex-shrink: 0;
}
.onboard-steps span { flex: 1; text-align: center; padding: 4px 0; border-bottom: 2px solid var(--line); }
.onboard-steps span.on { color: var(--text); border-bottom-color: var(--accent, #2563eb); font-weight: 600; }
.onboard-body {
  flex: 1 1 auto; min-height: 0; margin: 0;
  display: flex; flex-direction: column;
}
.onboard-fields { flex: 1 1 auto; min-height: 0; }
.onboard-act { width: 100%; margin-top: auto; flex-shrink: 0; }
.onboard-avatar-preview { display: flex; justify-content: center; margin: 8px 0; }
.count-dot { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: var(--radius); background: var(--red); color: #fff; font-size: 11px; text-align: center; margin-left: 4px; }

/* 我的账号 */
.me-head { display: flex; gap: 14px; align-items: center; }
.me-avatar { position: relative; }
.avatar-btn { position: relative; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; display: block; }
.avatar-edit { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,.42); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.avatar-edit .ic { width: 20px; height: 20px; }
.avatar-btn:hover .avatar-edit, .avatar-btn:focus-visible .avatar-edit { opacity: 1; }
.me-info { flex: 1; min-width: 0; }
.me-name { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.icon-btn { background: none; border: 0; padding: 3px; border-radius: var(--radius); color: var(--muted); cursor: pointer; display: inline-flex; line-height: 0; }
.icon-btn:hover { color: var(--text); background: var(--gray-soft); }
.me-id { display: flex; align-items: center; gap: 4px; }
.role-ic { color: var(--green); display: inline-flex; cursor: default; }
.role-ic .ic { width: 15px; height: 15px; }
.nick-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nick-edit .input { width: 140px; padding: 5px 8px; }
.nick-edit .hint { flex-basis: 100%; }
.pop { position: absolute; z-index: 61; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.14); padding: 10px; }
/* 须高于 .tm-mask(940)，否则遮罩挡掉上传/换一批点击 */
.avatar-pop { left: 0; top: calc(100% + 6px); min-width: 140px; z-index: 950; }
.avatar-pop .avatar-grid { gap: 4px; }
.pop-foot { display: flex; gap: 14px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.avatar-upload-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; cursor: pointer; box-sizing: border-box;
}
.onboard-avatar-actions { display: flex; justify-content: center; margin-top: 12px; }
.onboard-avatar-actions .avatar-upload-btn { width: auto; min-width: 140px; }
/* XY-220：同壳；中区居中上头像/昵称/id；仅底「登录」按钮进 */
.login-quick-wrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; width: 100%;
}
.login-quick {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  max-width: 100%; text-align: center;
}
.login-quick .avatar { flex-shrink: 0; }
.login-quick-name {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%;
  font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.login-quick-name .role-ic { flex-shrink: 0; }
.login-quick-name .role-ic .ic { width: 14px; height: 14px; }
.login-quick-id { font-size: 12px; line-height: 1.25; }
.login-quick-err { display: block; text-align: center; max-width: none; margin: 0; }
.login-foot-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: auto; padding-top: 10px; width: 100%; flex-shrink: 0;
}
.login-foot-row .link-btn,
.login-foot-row .phone-qr-trigger {
  margin: 0; padding: 0; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
  text-decoration: none; line-height: 1.35;
}
.login-foot-row .link-btn:hover,
.login-foot-row .phone-qr-trigger:hover { color: var(--text); }
.login-phone-inline { position: relative; display: inline-flex; }
.pw-wrap.plain .input { padding-right: 10px; }
.icon-text { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.icon-text:hover { color: var(--text); }
.me-actions { display: flex; gap: 20px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* 图标在各处的尺寸与对齐 */
.back-link { display: inline-flex; align-items: center; gap: 2px; }
.back-link .ic { width: 18px; height: 18px; }
.with-ic { display: inline-flex; align-items: center; gap: 3px; }
.with-ic .ic { width: 15px; height: 15px; }
.thumbs .th .x { display: flex; align-items: center; justify-content: center; padding: 0; }
.thumbs .th .x .ic { width: 14px; height: 14px; }
.thumbs .add .ic { width: 22px; height: 22px; }
.combo .caret { display: inline-flex; }
.combo .caret .ic { width: 14px; height: 14px; }
.topbar button .ic { width: 22px; height: 22px; display: block; }
.link-btn .ic { width: 14px; height: 14px; }
.lock-banner .ic, .hint .ic { width: 14px; height: 14px; vertical-align: -2px; }

/* 共享悬停浮窗 .ui-tip：由 UiTip JS 挂到 body；[data-tip] 触发；无过渡、无延迟 */
.ui-tip {
  position: fixed;
  z-index: 1000;
  box-sizing: border-box;
  max-width: min(280px, calc(100vw - 16px));
  padding: 4px 8px;
  border-radius: var(--radius);
  background: #111827;
  color: #f9fafb;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  /* 即时显隐：禁止任何过渡/延迟 */
  transition: none !important;
  animation: none !important;
}
.ui-tip[hidden] { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ui-tip { background: #e5e7eb; color: #111827; }
}
:root[data-theme="dark"] .ui-tip { background: #e5e7eb; color: #111827; }

/* 页面主操作：顶部一行靠左；表单提交：右对齐页脚 */
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* 首页：信息/待办在上；下方安静描边入口（可点、非大主按钮墙） */
.home-info { margin-bottom: 14px; max-width: none; }
.home-msg {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: inherit; text-decoration: none;
}
.home-msg:hover { border-color: var(--line-strong); }
.home-msg.hot { border-color: var(--primary-line); background: var(--primary-soft); }
.home-msg-ic { display: flex; color: var(--muted); flex-shrink: 0; }
.home-msg.hot .home-msg-ic { color: var(--primary-text); }
.home-msg-ic .ic { width: 20px; height: 20px; }
.home-msg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-msg-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.home-msg-sum { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.home-msg > .ic { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.home-sec-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: .02em; margin: 0 0 6px; padding: 0 2px;
}
.home-todos { display: flex; flex-direction: column; gap: 2px; }
.home-todo {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  color: inherit; text-decoration: none; font-size: 14px;
}
.home-todo:hover { background: var(--panel-2); }
.home-todo-l { flex: 1; min-width: 0; color: var(--text); }
.home-todo-v {
  font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--text-2); font-size: 13px; min-width: 1.5em; text-align: right;
}
.home-calm { margin: 4px 2px 0; font-size: 13px; }

.home-quick {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  max-width: none; margin-top: 10px; padding: 0;
}
.home-quick-link {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; min-height: 36px; padding: 8px 14px;
  border: 1px solid var(--primary); border-radius: var(--radius);
  background: var(--primary-soft); color: var(--primary-text);
  font-size: 13px; font-weight: 600; line-height: 1.3;
  text-decoration: none; cursor: pointer;
}
.home-quick-link:hover {
  border-color: var(--primary); color: var(--primary-text);
  background: var(--panel);
}
.home-quick-link:active { background: var(--panel-2); }

@media (max-width: 800px) {
  .home-info, .home-quick { max-width: none; }
  .home-msg { padding: 11px 12px; }
  .home-todo { padding: 9px 8px; }
  .home-quick-link { min-height: 40px; padding: 10px 16px; }
}
.form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-foot .btn { min-width: 84px; }

/* 个人设置 / 主题选择 */
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); padding: 8px 14px; border-radius: var(--radius); cursor: pointer; }
.choice:hover { border-color: var(--line-strong); }
.choice.on { border-color: var(--text); color: var(--text); font-weight: 600; }
/* 设置页：与「管理」共用 .list-item；外观与标题同行三项选择 */
.prefs { max-width: none; }
.prefs .list-item { width: 100%; text-align: left; font: inherit; cursor: pointer; }
button.list-item.prefs-action { appearance: none; }
button.list-item.prefs-action:disabled { opacity: .55; cursor: default; }
.prefs-theme-item { cursor: default; }
.prefs-theme-item .top { flex-wrap: nowrap; gap: 12px; align-items: center; }
.prefs-theme { display: inline-flex; flex-wrap: wrap; gap: 6px; flex: 0 1 auto; justify-content: flex-end; }
.prefs-theme .choice.sm { padding: 4px 10px; font-size: 13px; }
/* 上传表单：标签右侧的扫码入口 */
.label-row { display: flex; align-items: center; justify-content: space-between; }
.scan-btn { margin-bottom: 4px; }

/* 在线状态（仅超管的账号列表） */
.presence { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 400; }
.presence i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.presence.on i { background: var(--green); }

/* 消息（站内信）：单一主表面，点开展开，无二级菜单 */
.net-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin-bottom: 12px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; border: 1px solid transparent;
}
.net-bar .ic { width: 18px; height: 18px; }
.net-bar.off { background: color-mix(in srgb, var(--red) 12%, var(--panel)); border-color: var(--red-line); color: var(--red); }
.net-bar.ok { background: color-mix(in srgb, #16a34a 12%, var(--panel)); border-color: color-mix(in srgb, #16a34a 35%, var(--line)); color: #15803d; }
.letter-bar { display: flex; align-items: center; gap: 8px; background: var(--primary-soft); border: 1px solid var(--primary-line); color: var(--primary-text); padding: 9px 14px; border-radius: var(--radius); margin-bottom: 14px; font-weight: 600; }
.letter-bar .spacer { flex: 1; }
.letter-bar:hover { border-color: var(--primary); }
.letters-page .page-head { flex-wrap: wrap; gap: 8px 12px; }
.letters-page .page-head .letter-filters { flex-shrink: 0; }
.letters-page .page-head .view-switch button { padding: 0 10px; font-size: 13px; }
.letter-compose { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.letter-row { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 8px; overflow: hidden; }
.letter-row.open { border-color: var(--line-strong); }
.letter-row-head { display: block; width: 100%; text-align: left; border: 0; background: none; color: inherit; padding: 12px 14px; cursor: pointer; font: inherit; }
.letter-row-head:hover { background: var(--panel-2); }
.letter-preview { display: block; color: var(--text-2); font-size: 14px; margin: 6px 0 0 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.letter-row.unread .letter-preview { color: var(--text); font-weight: 600; }
.letter-from { display: flex; align-items: center; gap: 8px; }
.letter-from .spacer { flex: 1; }
.letter-chevron { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.letter-row.open .letter-chevron { transform: rotate(0deg); }
.letter-expand { padding: 0 14px 14px; border-top: 1px solid var(--line); }
/* 顶栏右侧：已读头像（明暗）→ 状态胶囊 → 箭头；胶囊宽度统一对齐 */
.letter-readers-mini { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.letter-status { flex-shrink: 0; min-width: 4.8em; text-align: center; }
.letter-action-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 8px 0 4px; }
.letter-action-mode .view-switch { flex-wrap: wrap; }
.letter-action-mode .view-switch button { padding: 0 10px; font-size: 12px; height: 28px; line-height: 26px; }
.letter-row.archived-row { opacity: .88; }
.letter-row.pinned { border-color: color-mix(in srgb, var(--orange-line, #f59e0b) 55%, var(--line)); }
.letter-pin-mark {
  flex-shrink: 0; font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 5px; border-radius: var(--radius); background: var(--orange-soft, #fff7ed); color: var(--orange-text, #c2410c);
}
.letter-ctx {
  position: fixed; z-index: 1100; min-width: 148px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.16); transition: none !important;
}
.letter-ctx button {
  display: block; width: 100%; border: 0; background: none; text-align: left;
  font: inherit; font-size: 13px; color: var(--text-2); padding: 8px 10px; border-radius: var(--radius); cursor: pointer;
}
.letter-ctx button:hover { background: var(--gray-soft); color: var(--text); }
.letter-ctx button:disabled { opacity: .45; cursor: default; }
.job-title-edit { display: flex; gap: 8px; align-items: center; }
.job-title-edit .input { flex: 1; min-width: 0; }
.reader-ava { display: inline-flex; align-items: center; color: var(--text-2); }
.reader-ava.named { flex-direction: column; gap: 4px; width: 48px; text-align: center; }
.reader-ava-img { position: relative; display: block; line-height: 0; border-radius: 50%; }
/* 未读淡化；已读正常亮度——不用绿色勾 */
.reader-ava.unread .avatar { opacity: .38; filter: grayscale(.6); }
.reader-ava.unread .reader-name { opacity: .5; }
.reader-name { display: block; width: 100%; font-size: 11px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ava { border-radius: 50%; background: var(--gray-soft); color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-ava.sm { width: 28px; height: 28px; }
.letter-body { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.ref-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; color: var(--text-2); background: var(--panel); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0 2px; }
a.ref-chip:hover { border-color: var(--line-strong); }
.ref-chip .ic { width: 14px; height: 14px; color: var(--muted); }
.group-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.group-chip { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.group-chip > button { border: 0; background: none; color: var(--text-2); font-size: 12px; padding: 3px 8px; cursor: pointer; line-height: 1.3; }
.group-chip > button:hover { color: var(--text); background: var(--gray-soft); }
.group-chip > button.x { padding: 3px 5px; color: var(--muted); border-left: 1px solid var(--line); }
.group-chip > button.x .ic { width: 12px; height: 12px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.filter-chip { border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12px; padding: 3px 9px; border-radius: var(--radius); cursor: pointer; line-height: 1.3; }
.filter-chip:hover { color: var(--text-2); border-color: var(--line-strong); }
.filter-chip.on { color: var(--text); border-color: var(--text); background: var(--gray-soft); }
.tag-pill { display: inline-block; padding: 1px 7px; margin: 1px 3px 1px 0; border-radius: var(--radius); font-size: 12px; background: var(--gray-soft); color: var(--text-2); white-space: nowrap; }
.tag-pill.pick { border: 1px solid var(--line); background: var(--panel); cursor: pointer; margin: 0; }
.tag-pill.pick.on { border-color: var(--text); color: var(--text); background: var(--gray-soft); font-weight: 500; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.count-tag { display: inline-block; margin-left: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.choice.sm { padding: 4px 10px; font-size: 13px; }
/* 收信人：头像在上、昵称在下（昵称短，格子尽量窄；无卡片底） */
.people-grid { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 48px; border: 0; background: none; color: var(--muted); padding: 2px 0 0; border-radius: 0; cursor: pointer; text-align: center; }
.person.static { cursor: default; color: var(--text-2); }
.person-ava { position: relative; display: block; line-height: 0; border-radius: 50%; box-shadow: 0 0 0 1.5px transparent; transition: box-shadow .12s; }
.person-name { display: block; width: 100%; font-size: 12px; line-height: 1.15; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-check { display: none; position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); color: var(--panel); align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px var(--bg); }
.person-check .ic { width: 10px; height: 10px; }
.person:hover { color: var(--text-2); }
.person:hover .person-ava { box-shadow: 0 0 0 1.5px var(--line-strong); }
.person.on { color: var(--text); }
.person.on .person-ava { box-shadow: 0 0 0 1.5px var(--text); }
.person.on .person-check { display: flex; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; cursor: pointer; }
.picker-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.picker-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.picker-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; text-align: left; color: var(--text); }
.picker-row .grow { flex: 1; min-width: 0; }
.picker-row:first-child { border-top: 0; }
.picker-row:hover { background: var(--panel-2); }
.picker-row.on { background: var(--gray-soft); }

/* 扫码弹窗：近全幅取景，引导框只做轻提示（解码用整帧） */
.scan-modal { max-width: min(560px, 94vw); width: 100%; }
.scan-view { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 桌面端预览镜像（用户期望）；解码仍用未镜像帧。手机触控设备不加 .mirror */
.scan-view video.mirror { transform: scaleX(-1); }
.scan-frame {
  position: absolute; inset: 4%;
  border: 1.5px solid rgba(255,255,255,.78);
  border-radius: var(--radius);
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.18);
  pointer-events: none;
}
.scan-modal .foot { justify-content: flex-start; }
.scan-modal .foot .spacer { flex: 1; }
@media (min-width: 800px) {
  .scan-modal { max-width: 640px; }
  .scan-view { aspect-ratio: 4 / 3; }
}

/* 在手机上登陆：悬停二维码（与视角浮窗同 .um-float）；窄屏/触摸端由 PhoneQr 不渲染 */
.phone-qr { position: relative; display: inline-flex; }
.phone-qr-pop.um-float {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 220px; padding: 12px; text-align: center;
}
.phone-qr-pop.below { top: calc(100% + 6px); left: 50%; transform: translateX(-50%); }
.phone-qr-pop.above { bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); }
.phone-qr-pop.side { left: calc(100% + 6px); bottom: -4px; }
.phone-qr-pop.right { left: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
.phone-qr-pop.left {
  right: calc(100% + 8px); left: auto; top: auto; bottom: 0; transform: none;
}
/* XY-216：登录底栏扫码浮窗桌面改右侧，不挡主面板 */
.login-foot-row .phone-qr-pop.right {
  left: calc(100% + 10px); right: auto; top: auto; bottom: 0; transform: none;
}
.phone-qr-pop img { width: 180px; height: 180px; image-rendering: pixelated; }
.phone-qr-pop::before { content: ''; position: absolute; inset: -10px; z-index: -1; }
.login-phone { display: flex; justify-content: center; margin: 14px auto 0; width: fit-content; }
.tm-list .phone-qr { display: flex; width: 100%; }
.tm-list .phone-qr-trigger { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: var(--radius); font-size: 13px; color: var(--text-2); }
.tm-list .phone-qr-trigger:hover { background: var(--gray-soft); }
.tm-list .phone-qr-trigger .ic { color: var(--muted); }
.tm-list button.danger, .tm-list button.danger .ic { color: var(--red); }
.tm-logout-confirm {
  display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 8px;
  border-radius: var(--radius); background: var(--gray-soft);
}
.tm-logout-q {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); font-weight: 600;
}
.tm-logout-q .ic { width: 18px; height: 18px; color: var(--red); }
.tm-logout-acts { display: flex; gap: 6px; }
.tm-logout-acts button {
  flex: 1; justify-content: center; width: auto; padding: 6px 8px; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text-2);
}
.tm-logout-acts button:hover { background: var(--panel); color: var(--text); border-color: var(--line-strong); }
.tm-logout-acts button.danger {
  color: #fff; background: var(--red); border-color: var(--red); font-weight: 600;
}
.tm-logout-acts button.danger:hover { filter: brightness(0.95); color: #fff; background: var(--red); }
.tm-logout-acts button.danger .ic { color: #fff; }
.phone-qr-pop .mono { color: var(--text-2); }

/* 链接按钮、导航、图标、图片都不允许拖出来（像桌面应用一样） */
a, img, svg, button, .btn { -webkit-user-drag: none; user-drag: none; }
.btn, .nav a, .tabs button, .view-switch button, .seg-control button, .filter-toggle, .um-trigger, .tm-list button, .icon-text, .chat-item { user-select: none; -webkit-user-select: none; }

/* 管理页 / 人员：头像+昵称在下；在线人数与「管理」同字号、仅颜色更淡 */
/* 与「管理」同字号，颜色再淡一档（比 --muted 更安静） */
.page-head .staff-count { font-size: 20px; font-weight: 400; line-height: 1.2; color: color-mix(in srgb, var(--muted) 58%, transparent); }
.staff-block { margin-bottom: 16px; }
.staff-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 6px; margin-bottom: 6px; }
/* XY-146：人员头像条与「新建人员」之间不加分割线 */
.staff-switch { margin-bottom: 10px; }
.staff-ava { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 48px; color: var(--text-2); text-decoration: none; border-radius: var(--radius); padding: 2px 0; background: none; border: 0; font: inherit; }
a.staff-ava, button.staff-ava { cursor: pointer; }
a.staff-ava:hover, button.staff-ava:hover { color: var(--text); }
span.staff-ava { cursor: default; }
.staff-ava.cur { color: var(--text); }
.staff-ava.cur .staff-ava-img { outline: 2px solid var(--primary); outline-offset: 1px; }
.staff-ava-img { position: relative; display: block; line-height: 0; border-radius: 50%; }
.staff-ava.off .avatar { opacity: .45; filter: grayscale(.6); }
.staff-ava.off .staff-name { opacity: .55; }
.staff-ava-img > i { position: absolute; right: 0; top: 0; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); border: 2px solid var(--bg); }
.staff-ava-img > i.on { background: var(--green); }
.staff-name { display: block; width: 100%; font-size: 11px; line-height: 1.15; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 人员面板 XY-150：上账号 / 下权限，直角克制 */
.staff-detail { max-width: none; }
.staff-panels { display: flex; flex-direction: column; gap: 12px; }
.staff-acct, .staff-perm {
  border-radius: var(--radius);
  padding: 16px 16px 14px;
}
.staff-acct-top {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 4px;
}
.staff-acct-title { flex: 1; min-width: 0; }
.staff-acct-name {
  font-size: 17px; font-weight: 700; line-height: 1.25;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.staff-acct-name .badge { font-size: 11px; font-weight: 600; }
.staff-acct-meta {
  margin-top: 4px; line-height: 1.35;
  color: color-mix(in srgb, var(--muted) 88%, transparent);
}
/* XY-154 / XY-200：标注与昵称同一行；id 改不了，显示在昵称下方 */
.staff-acct .field { margin-top: 8px; margin-bottom: 0; }
.staff-acct .field > label { margin-bottom: 3px; }
.staff-acct .field .hint { margin-top: 2px; }
.staff-acct .row2 { margin-top: 8px; gap: 8px; }
.staff-acct .staff-nick-alone { grid-column: 1 / -1; }
.staff-acct .job-title-edit { gap: 6px; }
.staff-more { position: relative; flex-shrink: 0; margin: -4px -6px 0 0; align-self: center; }
.staff-more-btn {
  color: var(--muted); width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
}
.staff-more-btn:hover { color: var(--text); background: var(--gray-soft); }
.staff-more-btn .ic { width: 22px; height: 22px; display: block; margin: 0; }
.staff-label-hint { font-weight: 400; font-size: 12px; margin-left: 6px; }
.staff-more-pop {
  right: 0; top: calc(100% + 4px); left: auto;
  min-width: 148px; padding: 4px; border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 0;
}
.staff-more-pop button,
.staff-more-pop a {
  display: block; width: 100%; border: 0; background: none;
  text-align: left; padding: 8px 10px; font: inherit; font-size: 13px;
  color: var(--text-2); cursor: pointer; text-decoration: none; border-radius: var(--radius);
}
.staff-more-pop button:hover,
.staff-more-pop a:hover { background: var(--gray-soft); color: var(--text); }
.staff-more-pop button.danger { color: var(--red); }
.staff-more-pop button.danger:hover { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); }
.staff-panel-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.staff-super-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer; user-select: none;
}
.staff-perm-foot { margin-top: 16px; padding-top: 12px; }
@media (max-width: 800px) {
  .staff-acct, .staff-perm { padding: 14px 12px 12px; }
  .staff-acct-name { font-size: 16px; }
  .staff-more-pop { min-width: 160px; }
}

/* 已读：小图标 + 悬停头像；未读的变淡 */
.read-ind { position: relative; display: inline-flex; color: var(--line-strong); cursor: default; padding: 2px; }
.read-ind.all { color: var(--green); }
.read-ind .ic { width: 16px; height: 16px; }
.read-pop { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.14); padding: 8px; min-width: 150px; max-width: 280px; flex-wrap: wrap; gap: 6px; }
.read-pop::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.read-ind:hover .read-pop { display: flex; }
.read-person { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.read-person.unread { opacity: .4; filter: grayscale(1); }
/* 登录页：二维码贴着登录框右侧浮出，不挡输入框 */
.login { position: relative; }
.login .phone-qr.login-phone { position: static; }
.login .phone-qr-pop.right { left: calc(100% + 12px); top: auto; bottom: 0; transform: none; }
@media (max-width: 700px) { .login .phone-qr-pop.right { left: 50%; top: calc(100% + 8px); bottom: auto; transform: translateX(-50%); } }
.letter-bar .bar-x { color: inherit; opacity: .6; margin-left: 4px; } .letter-bar .bar-x:hover { opacity: 1; background: none; }

/* 侧栏的数字：不用红圆点，靠右的灰色小数字 */
.nav .count-dot { margin-left: auto; background: rgba(255,255,255,.12); color: #e5e7eb; font-weight: 600; min-width: 20px; height: 18px; line-height: 18px; border-radius: var(--radius); }
.nav a.active .count-dot { background: rgba(255,255,255,.2); }

/* 消息展开区：正文、处理备注、回信（已读并入顶栏头像角标，不再占大块底栏） */
.letter-body { margin-top: 12px; }
.letter-progress { margin-top: 8px; }
.letter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.letter-actions .spacer { flex: 1; }
.done-note { margin-top: 8px; color: var(--text-2); font-size: 13px; white-space: pre-wrap; padding: 6px 8px; background: var(--panel-2); border-radius: var(--radius); }
.letter-replies { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.letter-reply { display: flex; gap: 8px; align-items: flex-start; }
.letter-reply-main { flex: 1; min-width: 0; }
.letter-reply-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; font-size: 13px; }
.letter-reply-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.55; color: var(--text); }
.letter-reply-form { margin-top: 12px; display: flex; gap: 8px; align-items: flex-end; }
.letter-reply-form .input { flex: 1; min-height: 44px; resize: vertical; }
.letter-reply-form .btn { flex-shrink: 0; }
@media (max-width: 640px) {
  .letters-page .page-head .letter-filters { order: 3; width: 100%; overflow-x: auto; }
  .letters-page .page-head .view-switch { display: flex; width: max-content; max-width: 100%; }
  .letter-reply-form { flex-direction: column; align-items: stretch; }
}
/* 侧栏左上角：线上灰度蓝标；本地彩色绿标 + local 字样（不可点） */
.brand-logo {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 16px 14px; width: fit-content; pointer-events: none; user-select: none;
}
.brand-logo img { width: 22px; height: 22px; display: block; filter: grayscale(1); opacity: .55; }
.brand-logo.local img { filter: none; opacity: 1; }
.brand-local {
  color: #16a34a; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  line-height: 1; user-select: none;
}
.brand-local.test { color: #7c3aed; }
/* XY-145：桌面不显示返回；移动端侧栏展开时用返回键替 logo */
.brand-back { display: none; }
@media (max-width: 800px) {
  .sidebar.open .brand-back {
    display: flex; align-items: center; justify-content: center;
    margin: 10px 12px 6px; padding: 6px; width: 36px; height: 36px;
    background: none; border: 0; border-radius: var(--radius); color: #d1d5db; cursor: pointer;
  }
  .sidebar.open .brand-back:hover { background: rgba(255,255,255,.06); color: #fff; }
  .sidebar.open .brand-back .ic { width: 22px; height: 22px; display: block; }
  .sidebar.open .brand-logo { display: none; }
}

/* ---------- 价格表（紧凑长列表 + 可折叠档位） ---------- */
/* 价格表：一板（分类+列表+添加），高密度，少装饰 */
.price-list-page { max-width: none; }
.price-list-page .page-head.compact { margin-bottom: 6px; gap: 8px; align-items: center; }
.price-list-page .page-head.compact h1 { margin: 0; font-size: 18px; line-height: 1.2; }
.price-list-page .page-head .price-search {
  width: min(180px, 36vw); height: 26px; padding: 2px 8px; font-size: 12.5px; flex: 0 1 180px;
}

.price-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
  display: flex; flex-direction: column; min-height: 0;
}
.price-cats {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.price-cats button {
  margin: 0; border: 0; border-right: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--muted); font: inherit; font-size: 12px;
  padding: 4px 9px; cursor: pointer; line-height: 1.2;
}
/* XY-166：末项（外设）也保留右边分割线，与其它分类一致 */
.price-cats button:hover { color: var(--text); background: var(--panel); }
.price-cats button.on { color: var(--text); font-weight: 600; background: var(--panel); }

.price-list-scroll {
  max-height: min(68vh, 620px); overflow: auto; overscroll-behavior: contain;
}
.price-block { border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.price-block:last-child { border-bottom: 0; }
/* XY-169/176/178：行跟随预览。勿对拖中源加 pointer-events:none（会取消 HTML5 拖拽） */
.price-block.dragging { opacity: .4; }
.price-block.dragging > .price-row { background: var(--panel-2); }
.price-list-page.proto.edit .price-block { cursor: grab; }
.price-list-page.proto.edit .price-block:active { cursor: grabbing; }
.price-block.saving > .price-row { background: color-mix(in srgb, var(--primary) 5%, transparent); }

.price-list-page.proto .price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 64px;
  gap: 0 8px; align-items: center;
  padding: 0 8px; min-height: 24px; position: relative;
}
.price-list-page.proto.edit .price-row {
  grid-template-columns: minmax(0, 1fr) 84px 64px 22px;
  padding-right: 4px;
}
.price-row.price-colhead {
  min-height: 18px; padding-top: 3px; padding-bottom: 1px;
  font-size: 10px; font-weight: 600; letter-spacing: .02em; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 1;
}
.price-row.price-colhead .col-price { text-align: left; padding-left: 0; }
.price-row .col-name { min-width: 0; display: flex; align-items: center; }
.price-row .col-name .input.bare { flex: 1; min-width: 0; width: 100%; }
.price-row .name-ro {
  font-size: 12.5px; font-weight: 500; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 0;
}
.price-row .col-price {
  /* XY-163：价格列左对齐，与数字同列；无 ¥ */
  text-align: left; display: flex; align-items: center; justify-content: flex-start; gap: 0; min-width: 0;
}
.price-row .col-price .price {
  display: block; width: 100%; font-variant-numeric: tabular-nums; font-size: 12.5px; line-height: 1.2; padding: 3px 0;
  text-align: left;
}
.price-list-page.proto .price-row .input.bare {
  border: 0; background: transparent; height: 22px; padding: 1px 0; font-size: 12.5px; border-radius: 0;
  box-shadow: none;
}
.price-list-page.proto .price-row .input.bare:focus {
  outline: none; background: color-mix(in srgb, var(--primary) 5%, transparent);
}
.price-list-page.proto .price-row .price-inp {
  flex: 1 1 auto; min-width: 0; width: 100%; text-align: left; font-variant-numeric: tabular-nums;
  /* 去掉 number 上下步进 */
  -moz-appearance: textfield; appearance: textfield;
}
.price-list-page.proto .price-row .price-inp::-webkit-outer-spin-button,
.price-list-page.proto .price-row .price-inp::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.price-list-page.proto .row-del {
  opacity: 0; pointer-events: none;
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.price-list-page.proto .price-row:hover .row-del,
.price-list-page.proto .price-row:focus-within .row-del,
.price-list-page.proto .row-del.confirm { opacity: 1; pointer-events: auto; }
.price-list-page.proto .row-del:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.price-list-page.proto .row-del .ic { width: 13px; height: 13px; }
/* XY-164：待确认态嵌在删除位，克制文案 */
.price-list-page.proto .row-del.confirm {
  width: auto; min-width: 20px; height: 20px; padding: 0 6px;
  font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent);
  position: absolute; right: 4px; z-index: 2;
}
.price-list-page.proto .row-del.confirm:hover,
.price-list-page.proto .row-del.confirm:focus {
  color: #fff; background: var(--red); outline: none;
}
.price-list-page.proto .price-block.del-arm > .price-row { background: color-mix(in srgb, var(--red) 4%, transparent); }

/* XY-167：末行草稿（无加号），与列表同密对齐 */
.price-add-row {
  border-top: 1px solid var(--line);
  background: var(--panel);
  margin: 0; width: 100%; box-sizing: border-box;
  flex-shrink: 0; min-height: 28px;
}
.price-add-row .col-act { width: 22px; height: 1px; }

.empty-row { padding: 8px; text-align: center; font-size: 12px; }

/* XY-163：总备注独立面板（与列表面板分离，同密度） */
.price-note-panel {
  margin-top: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 8px 10px 10px;
}
.price-note-block.compact {
  margin: 10px 0 0; padding: 0; border: 0; background: transparent; border-radius: 0;
}
.price-note-h { display: flex; align-items: center; gap: 6px; min-height: 20px; margin-bottom: 2px; }
.price-note-label { font-size: 11px; font-weight: 600; color: var(--muted); }
.price-note-body.md, .price-note-banner.md, .md { font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.price-note-body.md :is(h2, h3, h4), .price-note-banner.md :is(h2, h3, h4), .md :is(h2, h3, h4) {
  margin: 0.3em 0 0.15em; color: var(--text); font-size: 13px;
}
.price-note-body.md p, .price-note-banner.md p, .md p { margin: 0.2em 0; }
.price-note-body.md ul, .price-note-body.md ol,
.price-note-banner.md ul, .price-note-banner.md ol,
.md ul, .md ol { margin: 0.2em 0; padding-left: 1.2em; }
.price-note-body.md code, .price-note-banner.md code, .md code {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  background: var(--panel-2); padding: 0 4px; border-radius: var(--radius);
}
.price-note-banner {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 12px; margin-bottom: 10px;
}
.price-note-edit .btn-row.tight { margin-top: 6px; gap: 6px; }
.price-note-edit .input { font-size: 12.5px; min-height: 64px; }
.price-note-add { margin-top: 8px; font-size: 12px; color: var(--muted); }
.price-note-add:hover { color: var(--primary); }

.icon-btn.sm {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.icon-btn.sm:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.sm.danger:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.icon-btn.sm .ic { width: 15px; height: 15px; }

@media (max-width: 700px) {
  .price-list-page.proto .price-row { grid-template-columns: minmax(0, 1fr) 72px 56px; padding: 0 6px; }
  .price-list-page.proto.edit .price-row { grid-template-columns: minmax(0, 1fr) 72px 56px 20px; }
  .price-cats { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .price-cats button { flex: 0 0 auto; }
  .price-list-scroll { max-height: min(62vh, 520px); }
}


/* ---------- 搜集 master–detail（桌面左右；窄屏详情全幅） ---------- */
.lead-md {
  display: grid;
  grid-template-columns: minmax(280px, 40%) minmax(0, 1fr);
  gap: 0 14px;
  align-items: start;
}
.lead-md:not(.open) { grid-template-columns: 1fr; }
.lead-md:not(.open) .lead-md-placeholder { display: none; }
.lead-md-master { min-width: 0; }
.lead-md-detail {
  min-width: 0;
  position: sticky;
  top: 6px;
  max-height: calc(100vh - 20px);
  overflow: auto;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.lead-md-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; color: var(--muted); font-size: 13px;
  border-left: 1px solid var(--line); padding: 24px;
}
.lead-md .list-item.on {
  background: var(--gray-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}
@media (max-width: 860px) {
  .lead-md { display: block; }
  .lead-md.open .lead-md-master { display: none; }
  .lead-md.open .lead-md-detail {
    border-left: 0; padding-left: 0; position: static; max-height: none; overflow: visible;
  }
  .lead-md-placeholder { display: none !important; }
}

/* 价格表一版：核对时间、待核对筛选、跨分类时的分类标签 */
.price-row .col-upd { font-size: 11px; color: var(--muted); white-space: nowrap; text-align: left; }
.price-row .col-upd.stale { color: #b45309; font-weight: 600; }
.price-row .upd-btn {
  border: 0; background: transparent; padding: 2px 0; font: inherit; font-size: 11px; cursor: pointer; text-align: left;
}
.price-row .upd-btn:hover { color: var(--primary); text-decoration: underline; }
.price-row .cat-tag {
  flex: 0 0 auto; font-size: 10px; color: var(--muted); border: 1px solid var(--line);
  padding: 0 4px; margin-right: 6px; line-height: 16px;
}
.stale-chip {
  margin-left: 10px; border: 1px solid #f59e0b; background: color-mix(in srgb, #f59e0b 10%, transparent);
  color: #b45309; font: inherit; font-size: 12px; font-weight: 600; padding: 2px 8px; cursor: pointer; border-radius: 0;
}
.stale-chip.on { background: #f59e0b; color: #fff; }

/* 估值与「标价是估值的多少」 */
.est-box {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); background: var(--panel-2); font-size: 13px;
}
.lead-est { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 6px; font-size: 13px; }
.est-ratio { font-weight: 600; padding: 0 6px; line-height: 20px; border: 1px solid currentColor; }
.est-ratio.small { font-size: 11px; line-height: 16px; padding: 0 4px; margin-left: 6px; }
.est-ratio.good { color: #15803d; }
.est-ratio.mid { color: #b45309; }
.est-ratio.bad { color: var(--red); }
.combo-with-price { display: flex; align-items: center; gap: 8px; min-width: 0; }
.combo-with-price .combo { flex: 1; min-width: 0; }
.combo-with-price .row-price { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* 单机账 */
.money-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.money-strip b { font-size: 16px; font-variant-numeric: tabular-nums; }
.money-strip b.neg { color: var(--red); }
.static-val { padding: 7px 0; }

/* ===================== UI 统一（2026-10-28） =====================
 * 只收口尺寸 / 颜色 / 切换样式，不改结构：
 * 控件高度：工具栏 30、表单 32、小按钮 26（偏紧凑，信息密度优先）；
 * 切换统一一套：分段框，选中项深色实底；硬编码色改用主题变量。 */
:root { --ctrl-h: 30px; --field-h: 32px; --ctrl-sm-h: 26px; }

/* 按钮：固定最小高度，图标与文字垂直居中，不再随 padding/图标忽高忽低 */
.btn { min-height: var(--ctrl-h); padding: 0 14px; line-height: 1.2; font-size: 14px; }
.btn.sm { min-height: var(--ctrl-sm-h); padding: 0 10px; font-size: 13px; }
.btn.lg { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn .ic { width: 16px; height: 16px; flex-shrink: 0; }
.btn.sm .ic { width: 14px; height: 14px; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.green:hover, .btn.orange:hover, .btn.danger-solid:hover { filter: brightness(1.06); }
.btn.danger:hover { border-color: var(--red); background: var(--red-soft); }
.action-bar .btn, .form-foot .btn { min-height: var(--ctrl-h); }

/* 表单输入：输入框、下拉框同高（textarea 除外） */
.input:not(textarea), select.input { height: var(--field-h); padding-top: 0; padding-bottom: 0; }
select.input { padding-right: 26px; }

/* 切换：.tabs 与 .seg-control 同一套（原 .tabs 为黑底实心，和其它页不一致） */
.tabs {
  display: inline-flex; gap: 0; flex-wrap: wrap;
  border: 1px solid var(--line); background: var(--panel); margin-bottom: 12px;
}
.tabs button {
  border: 0; border-radius: 0; background: transparent; color: var(--muted);
  padding: 0 12px; min-height: 30px; font-size: 13px; line-height: 1.2;
}
.tabs button + button { border-left: 1px solid var(--line); }
.tabs button:hover:not(.on) { color: var(--text-2); }
.tabs button { min-height: 28px; }
.tabs button.on, .seg-control button.on { background: var(--text); color: var(--panel); border-color: var(--text); font-weight: 600; }
.seg-control button { min-height: 28px; padding: 0 11px; font-size: 13px; }

/* 紧凑密度：列表卡片、表格、表单间距统一收紧 */
.list-item { padding: 8px 12px; margin-bottom: 6px; }
.list-item .meta { margin-top: 2px; }
.field { margin-bottom: 10px; }
.field > label { margin-bottom: 3px; }
.card { padding: 12px 14px; margin-bottom: 10px; }
.page-head { margin-bottom: 12px; }
.action-bar { margin-bottom: 10px; }
table.t th, table.t td { padding: 6px 10px; font-size: 13px; }
table.t th { font-size: 12px; }

/* 徽标类：「待核对」「标价是估值的 xx%」改用主题色，深色模式也可读 */
.stale-chip {
  border: 1px solid var(--orange-line); background: var(--orange-soft); color: var(--orange-text);
}
.stale-chip:hover { border-color: var(--orange); }
.stale-chip.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.est-ratio { font-size: 12px; line-height: 20px; border-width: 1px; }
.est-ratio.good { color: var(--green); }
.est-ratio.mid { color: var(--orange); }

/* 首页待处理：与上方站内信同一卡片样式 */
.home-todos { gap: 0; border: 1px solid var(--line); background: var(--panel); }
.home-todo { padding: 11px 14px; border-radius: 0; }
.home-todo + .home-todo { border-top: 1px solid var(--line); }
.home-todo:hover { background: var(--gray-soft); }
.home-todo-v { color: var(--primary); font-size: 14px; }
.home-sec-label { margin-bottom: 8px; }

/* 仓库工具栏：筛选在前、搜索在后，状态下拉与类型下拉同宽 */
.stock-toolbar .stock-status { font-weight: 600; }

/* 管理页在线人数：与标题同行但不抢标题 */
.page-head .staff-count { font-size: 13px; color: var(--muted); }

/* 空状态：统一卡片里的居中灰字 */
.card > .muted:only-child { text-align: center; padding: 16px 0; }
.feedback-inbox-h { margin: 22px 0 10px; font-size: 15px; }

/* 切换人员视角：头像网格，昵称在头像下，人多也不出滚动条 */
.tm-viewas-pop {
  display: grid; grid-template-columns: repeat(4, 56px); gap: 2px;
  min-width: 0; max-width: none; max-height: none; overflow: visible; padding: 6px;
}
.tm-viewas-pop .viewas-empty { grid-column: 1 / -1; }
.tm-viewas-pop .viewas-item {
  flex-direction: column; gap: 3px; width: 56px; padding: 6px 2px; text-align: center; font-size: 12px;
}
.tm-viewas-pop .viewas-item-text { width: 100%; text-align: center; flex: none; }
@media (max-width: 700px) {
  .tm-viewas-pop { grid-template-columns: repeat(auto-fill, 56px); justify-content: start; }
}

/* ---------- 仓库（零件=售卖单位，整机=成本单位） ---------- */
.stock-page .page-head .btn { min-height: var(--ctrl-h); }
/* 仓库是表格页，宽屏放宽内容柱 */
@media (min-width: 1100px) { .main:has(.stock-page) { --main-max: 1180px; } }
.stock-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  border: 1px solid var(--line); background: var(--panel); margin-bottom: 10px;
}
.stock-stats > div, .stock-stats > button { padding: 7px 12px; display: flex; flex-direction: column; gap: 1px; }
.stock-stats > * + * { border-left: 1px solid var(--line); }
/* 环节格子可点：点哪格就切到哪个环节；选中用底色+底边，不改字重 */
.stock-stats > button { border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
.stock-stats > * + button { border-left: 1px solid var(--line); }
.stock-stats > button:hover { background: var(--panel-2); }
.stock-stats > button.on { background: var(--primary-soft); box-shadow: inset 0 -2px 0 var(--primary); }
.stock-stats b small { font-size: 11px; font-weight: 400; }
.stock-stats b.hot { color: var(--primary); }
.ava-row { display: inline-flex; gap: 3px; vertical-align: middle; line-height: 0; }
.idt-head { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; min-width: 0; }
.idt-head .idt-code { margin-left: auto; padding-left: 12px; }
.idt-head h2 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.idt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; margin-bottom: 12px; }
.idt-grid .kv { grid-template-columns: 64px 1fr; align-content: start; }
.idt-grid .kv + .kv { border-left: 1px solid var(--line); padding-left: 24px; }
.stock-stats + .stock-stats { margin-top: -11px; }
.stock-stats.money b.neg { color: var(--red); }
.stock-stats span { font-size: 12px; color: var(--muted); }
.stock-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.stock-pending { border: 1px solid var(--orange-line); background: var(--orange-faint); margin-bottom: 10px; }
.stock-pending-h { padding: 6px 12px; font-size: 13px; color: var(--orange-text); border-bottom: 1px solid var(--orange-line); }
.stock-pending-row { display: flex; align-items: center; gap: 10px; padding: 5px 12px; font-size: 13px; }
.stock-pending-row + .stock-pending-row { border-top: 1px solid color-mix(in srgb, var(--orange-line) 50%, transparent); }
.stock-pending-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.stock-bar .spacer { flex: 1; }
.seg-n { font-style: normal; font-size: 11px; margin-left: 5px; opacity: .7; font-variant-numeric: tabular-nums; }
.stock-bar .filter-chip { min-height: 28px; padding: 0 10px; font-size: 13px; }
.stock-search { display: flex; gap: 6px; flex: 0 1 300px; min-width: 200px; }
.stock-search .input { height: var(--ctrl-h); font-size: 13px; flex: 1; min-width: 0; }
.stock-search .btn { min-height: var(--ctrl-h); font-size: 13px; }
.stock-kinds { display: flex; flex-wrap: wrap; gap: 0 2px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.stock-kinds button {
  border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; padding: 4px 9px 6px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.stock-kinds button:hover { color: var(--text); }
.stock-kinds button.on { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.stock-kinds i { font-style: normal; font-size: 11px; margin-left: 3px; color: var(--muted); font-weight: 400; }
.stock-table { border: 1px solid var(--line); }
.stock-table tbody tr { cursor: pointer; }
.stock-table tbody tr:hover { background: var(--panel-2); }
.stock-table td { vertical-align: middle; white-space: nowrap; }
.stock-table td.ttl { white-space: normal; font-weight: 500; min-width: 140px; }
.stock-table td.ttl .badge { margin-left: 6px; }
.stock-table .from { margin-left: 6px; font-weight: 400; border: 1px solid var(--line); padding: 0 3px; font-size: 11px; white-space: nowrap; }
.stock-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stock-table td.old { color: var(--orange-text); font-weight: 600; }
.stock-table td.pos { color: var(--green); }
.stock-table td.neg { color: var(--red); }
.stock-table .act { width: 1%; text-align: right; }
.stock-table .act .btn-row { flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }
.stock-table .act .btn.sm { min-height: 24px; padding: 0 8px; font-size: 12px; }
.stock-table tr.done { color: var(--muted); }
.recover { display: inline-flex; align-items: center; gap: 6px; }
.recover .track { display: inline-block; width: 60px; height: 6px; background: var(--gray-soft); }
.recover .track i { display: block; height: 100%; background: var(--primary); }
.recover .track i.ok { background: var(--green); }
.recover em { font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; }
.stock-foot { margin-top: 6px; }
@media (max-width: 700px) {
  .stock-search { flex: 1 1 100%; }
  .stock-stats { grid-template-columns: repeat(3, 1fr); }
  .stock-stats > :nth-child(3n+1) { border-left: 0; }
  .stock-stats > :nth-child(n+4) { border-top: 1px solid var(--line); }
  .stock-stats.money { grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
  .stock-stats.money > * { border-left: 0; border-top: 0; }
  .stock-stats.money > :nth-child(2n) { border-left: 1px solid var(--line); }
  .stock-stats.money > :nth-child(n+3) { border-top: 1px solid var(--line); }
  .stock-table thead { display: none; }
  .stock-table, .stock-table tbody, .stock-table tr { display: block; }
  .stock-table tr { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
  .stock-table.t td { border: 0; padding: 0; font-size: 12px; }
  .stock-kinds { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stock-kinds button { flex: 0 0 auto; }
  .stock-table td.ttl { order: -1; flex: 1 1 100%; font-size: 14px; }
  .stock-table td.num[data-l]::before, .stock-table td[data-l="位置"]::before, .stock-table td[data-l="上架人"]::before { content: attr(data-l) ' '; color: var(--muted); }
  .stock-table .act { flex: 1 1 100%; width: auto; margin-top: 4px; }
  .stock-table .act .btn-row { justify-content: flex-start; }
}
/* 配置/配件逐行编辑：行距收紧，标签与输入框垂直居中 */
.parts-edit .prow { gap: 6px; margin-bottom: 4px; align-items: center; }
@media (max-width: 700px) {
  .parts-edit .prow, .parts-edit.priced .prow { padding: 6px; }
  .stock-pending-row { flex-wrap: wrap; gap: 4px 10px; }
  .stock-pending-row .t { flex: 1 1 60%; }
}
.parts-edit .cat { padding-top: 0; }

/* ---------- 登录与首次登录（邀请链接 / 快捷登录移除 / 引导就地报错） ---------- */
.login-quick-ava { position: relative; display: inline-flex; }
.login-quick-forget {
  position: absolute; top: -6px; right: -6px; padding: 2px;
  background: var(--card, var(--bg)); border: 1px solid var(--line); border-radius: 0;
}
.login-quick-forget .ic { width: 14px; height: 14px; }
.login-invite-err { color: var(--red); font-size: 13px; margin: 0 0 8px; }
.onboard-err { color: var(--red); font-size: 13px; margin: 0 0 8px; }
.onboard-nav { display: flex; gap: 8px; margin-top: auto; flex-shrink: 0; }
.onboard-nav .btn { flex: 1; }
.onboard-nav .btn:first-child { flex: 0 0 auto; }
.onboard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.onboard-foot .link-btn { font-size: 13px; }
.staff-invite { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.staff-invite-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.staff-invite-body { display: flex; gap: 12px; margin-top: 10px; align-items: flex-start; }
.staff-invite-qr { width: 120px; height: 120px; flex-shrink: 0; border: 1px solid var(--line); background: #fff; }
.staff-invite-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.staff-invite-url { word-break: break-all; padding: 6px 8px; background: var(--gray-soft); border: 1px solid var(--line); user-select: all; }
.staff-invite-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.staff-invite-main .hint { margin: 0; }
@media (max-width: 700px) { .staff-invite-qr { display: none; } }

/* ===================== 人员权限（2026-10-28）：岗位 + 模块级别 + 机密锁 + 预览 ===================== */
.pp { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; align-items: start; }
.pp-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pp-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.pp-k { flex: 0 0 auto; min-width: 40px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.pp-roles { flex-wrap: wrap; }
.pp-matrix { border-collapse: collapse; width: 100%; }
.pp-matrix th { width: 72px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 3px 8px 3px 0; white-space: nowrap; }
.pp-matrix td { padding: 3px 0; }
.pp-matrix tr.diff th { color: var(--text); }
.pp-matrix .seg-control button { min-height: 26px; padding: 0 9px; font-size: 12px; }
.pp-matrix .seg-control button:disabled { opacity: .35; cursor: default; }
.pp-diff { white-space: nowrap; padding-left: 8px !important; display: inline-flex; align-items: center; gap: 6px; }
.pp-locks { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.pp-locks-h { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.pp-locks-h .muted { font-weight: 500; }
.pp-lock { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px; border-radius: var(--radius); cursor: pointer; font-weight: normal; }
.pp-lock:hover { background: var(--gray-soft); }
.pp-lock:has(input:disabled) { cursor: default; opacity: .6; }
.pp-lock input { margin: 0; flex-shrink: 0; }
.pp-lock-t { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-width: 0; flex: 1; }
.pp-lock-t b { font-size: 13px; font-weight: 600; }
.pp-lock.on .pp-lock-t b { color: var(--red); }
.pp-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--gray-soft); padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 8px; }
.pp-preview-h { font-weight: 600; color: var(--text); }
.pp-pv { display: flex; gap: 6px; line-height: 1.45; color: var(--text-2); }
.pp-pv .pp-k { min-width: 36px; font-weight: 500; color: var(--muted); }
.pp-pv-i { display: block; }
.pp-hidden { color: var(--red); }
.perm-picker.readonly .pp-main { pointer-events: none; opacity: .7; }
@media (max-width: 760px) { .pp { grid-template-columns: 1fr; } .pp-preview { position: static; } }
.staff-self-edit { margin-left: auto; flex: 0 0 auto; }
.staff-self-edit + .staff-more { margin-left: 6px; }
.staff-archived-link { margin-left: auto; }
.roles-t th, .roles-t td { white-space: nowrap; }
.roles-t thead th { vertical-align: bottom; }
.roles-h { display: flex; align-items: baseline; gap: 6px; }
.roles-acts { display: flex; gap: 8px; margin-top: 2px; font-weight: 400; }
.table-wrap .roles-t { width: auto; }
.roles-sel { height: 28px; width: auto; min-width: 104px; padding: 0 6px; font-size: 12px; }
.roles-lock th { display: flex; align-items: center; gap: 4px; }
.roles-chk { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: normal; font-size: 12px; cursor: pointer; }
.onboard-lead { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.onboard-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.onboard-list li span { display: block; font-size: 12px; margin-top: 1px; }

/* ---------- 去布局跳动（2026-10-28） ----------
 * 提示/报错行预留高度；选中态不改字重（改字重会让按钮变宽、整行挪动）；
 * 页面高度变化时滚动条占位固定，左右不跳。 */
html { scrollbar-gutter: stable; }
.hint-slot { min-height: 22px; padding-top: 4px; }
.hint-slot > .hint { margin-top: 0; line-height: 18px; }
.err-slot > * { line-height: 18px; }
.err-slot { min-height: 18px; display: flow-root; }
.onboard-err { min-height: 20px; }
.label-row { min-height: 20px; }
.input.from-table { box-shadow: inset 3px 0 0 var(--primary); }
/* 选中/悬停只换颜色，不换字重和边框粗细 */
.seg-control button.on, .tabs button.on, .filter-toggle.on, .perm-chip.on, .tm-list button.on,
.view-switch button.on, .sort-pop button.on, .onboard-steps span.on, .choice.on, .filter-chip.on,
.tag-pill.pick.on, .price-cats button.on, .stock-kinds button.on, .lead-adv-btn.on {
  font-weight: inherit; -webkit-text-stroke: .35px currentColor;
}
.action-bar { align-items: center; }
/* 岗位表：下拉保持紧凑高度；锁行表头不用 flex（会让单元格背景断开）；表框贴合表格宽度 */
select.input.roles-sel { height: 28px; }
table.t.roles-t th, table.t.roles-t td { vertical-align: middle; }
table.t.roles-t thead th { vertical-align: bottom; }
.roles-lock th { display: table-cell; }
.roles-lock th .ic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.table-wrap:has(> .roles-t) { width: fit-content; max-width: 100%; }

/* 权限 v2：岗位卡 + 级别格（专用样式，和普通切换区分开）；邀请链接强调 */
.pp-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.pp-role { appearance: none; font: inherit; font-size: 12px; min-height: 28px; padding: 0 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: 0; background: var(--panel); color: var(--text-2); cursor: pointer; }
.pp-role:hover:not(.on) { border-color: var(--primary); color: var(--text); }
.pp-role.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.pp-role.quiet:not(.on) { color: var(--muted); border-style: dashed; }
.pp-ladder { display: grid; grid-template-columns: repeat(3, 92px); gap: 2px; }
.pp-lv { appearance: none; font: inherit; font-size: 12px; height: 26px; padding: 0 6px; border: 0; border-radius: 0; background: var(--gray-soft); color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-lv:hover:not(:disabled):not(.on) { color: var(--text); box-shadow: inset 0 0 0 1px var(--primary); }
.pp-lv.fill { background: var(--primary-soft); color: var(--primary); }
.pp-lv.on { background: var(--primary); color: #fff; font-weight: 600; }
.pp-lv.none.on { background: var(--line); color: var(--text); }
.pp-lv:disabled { cursor: default; opacity: .4; }
.pp-lock-note { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.pp-lock-legacy { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--red); }
@media (max-width: 560px) { .pp-ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; } .pp-matrix td:nth-child(2) { width: 100%; } }
.staff-invite { border: 1px solid var(--primary); background: var(--primary-soft); padding: 10px 12px; margin-top: 12px; }
.staff-invite-head b { color: var(--primary); }
.staff-invite-url { background: var(--panel); }

/* 账号菜单「退出登录」：原位确认，尺寸不变；关闭菜单时复原 */
.tm-list button.tm-logout { position: relative; overflow: hidden; }
.tm-list button.tm-logout.arm, .tm-list button.tm-logout.arm:hover { background: var(--red); color: #fff; }
.tm-list button.tm-logout.arm .ic { color: #fff; }

/* 岗位小字：名字下方/旁边，弱化显示，不跟名字抢 */
.um-role { font-size: 11px; color: inherit; opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-role { display: block; width: 100%; height: 13px; font-size: 10px; line-height: 13px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewas-role { display: block; font-size: 10px; color: var(--muted); line-height: 1.2; }
.staff-role .role-ic { display: inline-flex; vertical-align: top; }
.staff-role .role-ic .ic { width: 12px; height: 12px; }

/* 岗位角标：头像右下角小方块（岗位首字 + 低饱和色），超级管理员用强调色 */
.ava-b { position: relative; display: inline-block; flex-shrink: 0; line-height: 0; }
.ava-b > .avatar { display: block; }
.ava-role { position: absolute; right: -3px; bottom: -3px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-weight: 600; line-height: 1; color: #fff; border: 1.5px solid var(--panel); box-sizing: content-box; border-radius: 0; pointer-events: auto; }
.ava-role.sup { background: var(--primary); }
.ava-role.t0 { background: #6f86a6; }
.ava-role.t1 { background: #6f8f7f; }
.ava-role.t2 { background: #a07f6f; }
.ava-role.t3 { background: #8b7398; }
.ava-role.t4 { background: #8a7f5f; }
.ava-role.t5 { background: #5f8e95; }
.um-trigger .ava-role { border-color: var(--sidebar); }

/* ---------- 审批：一个待办列表，右侧固定两个按钮 ---------- */
.appr-sub { margin: -6px 0 8px; }
.appr-row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) 200px; gap: 0 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); padding: 8px 12px; margin-bottom: -1px;
}
.appr-row.turn { box-shadow: inset 3px 0 0 var(--orange); }
.appr-tag .badge { white-space: normal; }
.appr-what { font-size: 14px; line-height: 1.45; word-break: break-word; }
.appr-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.appr-impact { color: var(--text-2); }
.appr-note { margin-top: 2px; }
.appr-acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; text-align: right; }
.appr-acts .btn.sm { min-width: 52px; }
.appr-done-by { flex-basis: 100%; white-space: nowrap; }
.appr-empty { text-align: center; }
@media (max-width: 700px) {
  .appr-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .appr-acts { justify-content: flex-start; }
}

/* ---------- 搜集重做：录入（估价列、截图两组、手机传图）、谈判（成交信息、机密标记） ---------- */
.parts-edit.config-edit.est-edit .prow { grid-template-columns: 108px minmax(0, 1.3fr) minmax(0, 1fr) 118px 30px; }
.est-edit .prow .num { text-align: right; }
.est-edit .prow.missing .est-in { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.est-cell { display: flex; align-items: center; gap: 4px; min-width: 0; }
.est-in { text-align: right; font-variant-numeric: tabular-nums; min-width: 0; }
.est-in::-webkit-outer-spin-button, .est-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.est-src { flex: 0 0 auto; width: 20px; height: 18px; line-height: 16px; text-align: center; font-size: 11px; border: 1px solid var(--line); color: var(--muted); font-style: normal; }
.est-src.man { border-color: var(--orange); color: var(--orange); }
.est-src.ghost { visibility: hidden; }
.est-total { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.est-total b { font-size: 15px; font-variant-numeric: tabular-nums; }
.lead-form-tip { margin-left: auto; }
.lead-form-quick { display: none; gap: 8px; margin-bottom: 10px; }
.lead-form-quick .btn { flex: 1; justify-content: center; }
.lead-form-row { display: flex; gap: 10px; align-items: flex-start; }
.lead-form-row .grow { flex: 1 1 auto; min-width: 0; }
.lead-form-row .w-price { flex: 0 0 140px; }
.lead-form-row .w-views { flex: 0 0 110px; }
.lead-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot-group { border: 1px dashed transparent; padding: 6px 8px; margin: -6px -8px 0; }
.shot-group.on { border-color: var(--line-strong); }
.shot-group .thumbs .th, .shot-group .thumbs .add { width: 64px; height: 64px; }
.shot-inbox { border: 1px dashed var(--primary); background: var(--primary-soft); padding: 8px 10px; margin: 4px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.shot-inbox.empty { border-color: var(--line); background: transparent; }
.shot-inbox-h { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.shot-inbox-h .ic { width: 16px; height: 16px; color: var(--primary); }
.inbox-th { width: 64px !important; height: 64px !important; overflow: visible !important; }
.inbox-th.on { outline: 2px solid var(--primary); }
.inbox-pick { position: absolute; left: 0; top: 100%; z-index: 5; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 4px 12px rgba(0,0,0,.12); min-width: 72px; }
.inbox-pick button { appearance: none; border: 0; background: none; font: inherit; font-size: 12px; text-align: left; padding: 5px 8px; cursor: pointer; color: var(--text); }
.inbox-pick button:hover { background: var(--gray-soft); }
.inbox-pick button.del { color: var(--red); border-top: 1px solid var(--line); }
.lead-form-foot { align-items: center; }
.lead-form-foot .err-slot { margin-right: auto; }
.shots-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 120px; border: 1px dashed var(--line-strong); background: var(--panel); cursor: pointer; margin-bottom: 8px; color: var(--muted); }
.shots-drop .ic { width: 28px; height: 28px; }
.shots-page .thumbs { margin-top: 12px; }
@media (max-width: 700px) {
  .parts-edit.config-edit.est-edit .prow { grid-template-columns: minmax(0, 1fr) 104px 30px; }
  .est-edit .prow .pnote { grid-column: 1 / -1; order: 5; }
  .lead-form-quick { display: flex; }
  .lead-form-row { flex-wrap: wrap; }
  .lead-form-row .grow { flex-basis: 100%; }
  .lead-form-row .w-price, .lead-form-row .w-views { flex: 1 1 0; }
  .lead-shots { grid-template-columns: 1fr; }
  .lead-form-foot { position: sticky; bottom: 0; background: var(--panel); margin: 16px -16px -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 4; flex-wrap: wrap; }
  .lead-form-foot .err-slot { flex-basis: 100%; }
  .lead-form-foot .btn { flex: 1; }
}
/* 列表：谁在谈 / 缺单号 */
.lead-neg-who { color: var(--orange); font-weight: 600; }
.lead-neg-who.mine { color: var(--primary); }
.lead-warn { color: var(--orange); font-weight: 600; }
/* 详情：成交信息、机密标记、配置估价 */
.lock-tag { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.lock-tag .ic { width: 12px; height: 12px; }
.lead-kv { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 13px; }
.lead-kv dt { color: var(--muted); }
.lead-kv dd { margin: 0; min-width: 0; }
.lead-deal .lead-result-note { margin-top: 6px; }
.config-row:has(.config-est) { grid-template-columns: 88px minmax(0, 1fr) auto; }
.config-est { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.lead-shots-view { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.lead-shots-view .thumbs .th { width: 72px; height: 72px; }
/* 弹窗里的选项（放弃原因、快递 / 面交） */
.choice-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.choice-chips button { appearance: none; font: inherit; font-size: 13px; height: 28px; padding: 0 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; border-radius: 0; }
.choice-chips button:hover:not(.on) { border-color: var(--line-strong); }
.choice-chips button.on { background: var(--text); color: var(--panel); border-color: var(--text); -webkit-text-stroke: .2px currentColor; }
/* 搜集工作台和录入页放宽：左列表右详情、估价表都要横向空间 */
@media (min-width: 1100px) { .main:has(.lead-md.open), .main:has(.lead-form-page) { --main-max: 1180px; } }
@media (min-width: 1100px) { .main:has(.lead-form-page) { --main-max: 1000px; } }
.lead-filters .seg-control { flex-wrap: wrap; max-width: 100%; }
.lead-filters .seg-control button { white-space: nowrap; }
.config-row .config-name { min-width: 0; overflow-wrap: anywhere; }
.config-est { white-space: nowrap; }
.lead-filters .seg-control button { padding: 0 8px; }
@media (max-width: 700px) {
  /* 手机：没填型号的类只占一行，备注等填了型号再出现 */
  .est-edit .prow:not(.filled) .pnote { display: none; }
  .est-edit .prow { margin-bottom: 4px; }
}
/* 快捷键说明：右上角小图标，悬停 / 点击原地展开 */
.key-help { position: relative; display: inline-flex; }
.key-help .icon-btn .ic { width: 18px; height: 18px; }
.key-help-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 6px 10px; display: grid; gap: 4px; min-width: 250px; font-size: 12px; }
.key-help-row { display: grid; grid-template-columns: 116px 1fr; align-items: center; gap: 8px; white-space: nowrap; }
.key-help-row .keys { display: inline-flex; gap: 3px; }
.key-help kbd { font: inherit; font-size: 11px; line-height: 16px; min-width: 18px; padding: 0 4px; text-align: center; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--panel-2); color: var(--text); }
.key-help-pop { grid-template-columns: max-content max-content; gap: 5px 14px; min-width: 0; }
.key-help-row { display: contents; }

/* ---------- 新增目标商品 第二轮：链接一行 + 扫码并列、口令填入反馈、必填红框、配置表、草稿箱 ---------- */
.url-row { display: flex; gap: 6px; }
.url-row .input { flex: 1; min-width: 0; }
.url-row .scan-inline { flex: 0 0 auto; height: var(--field-h, 32px); padding: 0 12px; gap: 4px; }
.url-row .scan-inline .ic { width: 18px; height: 18px; }
.parse-ok { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.parse-ok .ic { width: 14px; height: 14px; }
.parse-ok.ok { color: var(--green); font-weight: 600; }
@keyframes wx-flash { 0% { background: var(--green-soft); } 100% { background: var(--panel); } }
.input.flash { animation: wx-flash 1.8s ease-out; }
.input.invalid, .field.invalid .cfg-row:nth-child(2) .combo input { border-color: var(--red); }
.field.invalid > label { color: var(--red); }
.lead-form .field { margin-bottom: 10px; }
.lead-form .hint-slot { min-height: 18px; }
/* 配置表 */
.cfg-edit { display: flex; flex-direction: column; gap: 4px; }
.cfg-row { display: grid; grid-template-columns: 84px minmax(0, 1.3fr) minmax(0, 1fr) 112px 24px; gap: 6px; align-items: center; }
.cfg-head { font-size: 12px; color: var(--muted); }
.cfg-head .num { text-align: right; }
.cfg-cat { display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.cfg-add, .cfg-del { appearance: none; border: 0; background: none; padding: 2px; color: var(--muted); cursor: pointer; display: inline-flex; line-height: 0; }
.cfg-add:hover, .cfg-del:hover { color: var(--text); background: var(--gray-soft); }
.cfg-add .ic { width: 14px; height: 14px; }
.cfg-del .ic { width: 15px; height: 15px; }
.cfg-est { position: relative; }
.cfg-est .est-in { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.cfg-est.flash .est-in { padding-left: 30px; }
.est-tag { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; line-height: 14px; padding: 0 2px; border: 1px solid var(--line-strong); color: var(--muted); pointer-events: none; }
.cfg-est .est-in::-webkit-outer-spin-button, .cfg-est .est-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@keyframes wx-price-flash { 0% { color: var(--green); background: var(--green-soft); } 100% { color: var(--text); background: var(--panel); } }
.cfg-est.flash .est-in { animation: wx-price-flash 1.6s ease-out; }
@keyframes wx-tag-flash { 0% { color: var(--green); border-color: var(--green); background: var(--green-soft); } 70% { opacity: 1; } 100% { color: var(--muted); border-color: var(--line-strong); background: transparent; opacity: 0; } }
.cfg-est.flash .est-tag { animation: wx-tag-flash 1.6s ease-out; }
.cfg-row.missing .est-in { border-color: var(--red); }
.cfg-total { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.cfg-total-l { grid-column: 1 / 3; }
.cfg-total-r { grid-column: 3 / 5; display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; padding-right: 8px; }
.cfg-total-r b { font-size: 15px; font-variant-numeric: tabular-nums; }
/* 草稿箱 */
.draft-box { position: relative; margin-right: 6px; }
.draft-box .btn.on { border-color: var(--text); }
.draft-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 280px; max-width: 360px; max-height: 320px; overflow-y: auto; }
.draft-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.draft-row:last-child { border-bottom: 0; }
.draft-row.on { box-shadow: inset 3px 0 0 var(--primary); }
.draft-open { flex: 1; min-width: 0; appearance: none; border: 0; background: none; font: inherit; text-align: left; padding: 6px 10px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; color: var(--text); }
.draft-open:hover { background: var(--gray-soft); }
.draft-open .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
@media (max-width: 700px) {
  .cfg-row { grid-template-columns: minmax(0, 1fr) 96px 24px; background: var(--panel-2); padding: 6px; }
  .cfg-row .cfg-cat { grid-column: 1 / -1; }
  .cfg-row .pnote { grid-column: 1 / -1; order: 5; }
  .cfg-row:not(.filled) .pnote { display: none; }
  .cfg-head { display: none; }
  .cfg-total { background: none; padding: 6px 0 0; }
  .cfg-total-l { grid-column: 1 / 2; }
  .cfg-total-r { grid-column: 2 / 4; padding-right: 0; }
}

/* 下拉箭头：整条右侧都可点 */
.combo .caret { top: 1px; bottom: 1px; right: 1px; width: 30px; transform: none; align-items: center; justify-content: center; }
.combo .caret:hover { color: var(--text); background: var(--gray-soft); }
.combo .input { padding-right: 32px; }
.combo-list .opt { display: flex; align-items: baseline; gap: 12px; }
.combo-list .opt-price { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 链接解析提示跟在「商品链接」标签后，不占额外一行 */
.url-label { display: flex; align-items: baseline; gap: 10px; min-height: 20px; margin-bottom: 3px; min-width: 0; }
.url-label label { margin: 0; flex: 0 0 auto; font-weight: 600; font-size: 13px; }
.url-label .hint { margin: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.key-help-btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.key-help-btn .ic { width: 18px; height: 18px; }
.key-help-btn:hover, .key-help-btn.on { color: var(--text); background: var(--gray-soft); }
.login-quick-go { padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: 50%; outline-offset: 3px; }
.login-quick-go:hover .avatar { box-shadow: 0 0 0 2px var(--accent, #2563eb); }
.login-quick-go:disabled { cursor: progress; }
/* 价格表：行内报错（不弹窗、不撑高行） */
.price-row .col-name { position: relative; }
.price-row .row-err { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--red); background: var(--panel); padding-left: 6px; pointer-events: none; white-space: nowrap; }
.price-row .input.bare.invalid { box-shadow: inset 0 0 0 1px var(--red); }
/* 自定义右键菜单（直角面板） */
.ctx-menu { position: fixed; z-index: 60; min-width: 200px; padding: 4px 0; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.ctx-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; height: 30px; padding: 0 12px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--gray-soft); outline: none; }
.ctx-keys { color: var(--muted); font-size: 11px; }
.price-ins-row { background: var(--gray-soft); }
.price-row .input.bare.blank-name { color: var(--muted); }
/* 目标商品详情 = 录入页同一界面：只读时字段不灰、隐藏编辑用的小按钮 */
.lead-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.lead-fs:disabled .input { background: var(--panel); color: var(--text); -webkit-text-fill-color: var(--text); opacity: 1; cursor: default; border-color: var(--line); }
.lead-fs:disabled .input::placeholder { color: transparent; -webkit-text-fill-color: transparent; }
.lead-fs:disabled .cfg-add, .lead-fs:disabled .cfg-del, .lead-fs:disabled .combo .caret, .lead-fs:disabled .cfg-edit > .hint { visibility: hidden; }
.lead-form .url-row .input:disabled { background: var(--panel); color: var(--text); -webkit-text-fill-color: var(--text); opacity: 1; border-color: var(--line); }
.lead-form .url-row .url-act { flex: 0 0 auto; height: var(--field-h, 32px); padding: 0 12px; }
.lead-view-code { font-size: 18px; letter-spacing: .02em; }
.lead-edit-btn { gap: 4px; }
.lead-edit-btn .ic { width: 16px; height: 16px; }
.lead-view-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: -6px 0 10px; font-size: 12px; }
/* 价格表完全展开，不在框内滚动 */
.price-list-scroll, .price-list-page .price-list-scroll { max-height: none; overflow: visible; }
.price-row .col-upd { color: color-mix(in srgb, var(--muted) 60%, transparent); font-size: 11px; }
.lead-form.viewing .shot-group.on { outline: 0; border-color: transparent; }
/* 估价比标价高/低：细灰框，不带颜色和评语 */
.est-diff { display: inline-block; padding: 0 4px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 谈判详情：整页，一眼看清 */
.neg-page { max-width: 1080px; }
.neg-page .neg-code { border: 0; background: none; padding: 0 4px; color: var(--muted); font-size: 11px; cursor: pointer; opacity: .75; }
.neg-page .neg-code:hover { opacity: 1; }
.neg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.neg-main { min-width: 0; }
.neg-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.neg-title-row { display: flex; align-items: center; gap: 8px; }
.neg-title { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 600; }
.neg-price-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.neg-ask { font-size: 22px; font-weight: 700; }
.neg-when { border-bottom: 1px dotted var(--line-strong); cursor: default; }
.neg-link-m { margin-top: 10px; }
.neg-ops { padding: 14px 0; border-bottom: 1px solid var(--line); }
.neg-ops .lead-lock-line { margin: 0 0 10px; }
.neg-side { position: sticky; top: 16px; display: grid; gap: 8px; justify-items: stretch; }
.neg-qr { text-align: center; border: 1px solid var(--line); background: #fff; padding: 10px 10px 6px; }
.neg-qr img { display: block; width: 100%; height: auto; }
.neg-qr p { margin: 4px 0 0; }
.neg-go { justify-content: center; gap: 4px; }
.config-total-row { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
@media (max-width: 760px) { .neg-layout { grid-template-columns: 1fr; } .neg-side { display: none; } }
/* 成交表单：同页展开 */
.neg-deal { padding: 14px 0; border-bottom: 1px solid var(--line); }
.neg-deal .deal-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.neg-deal .deal-label { font-size: 13px; color: var(--text-2); padding-top: 6px; }
.neg-deal .deal-body { display: grid; gap: 6px; min-width: 0; }
.neg-deal .deal-price { width: 160px; }
.neg-deal .deal-tip { margin: 0; font-size: 12px; color: var(--muted); }
.neg-deal .deal-track { position: relative; width: 260px; }
.neg-deal .deal-track .input { width: 100%; padding-right: 32px; }
.neg-deal .deal-scan { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 30px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.neg-deal .deal-scan:hover { color: var(--text); }
.neg-deal .deal-fee { display: grid; grid-template-columns: minmax(0, 200px) 110px 28px; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.neg-deal .deal-fee .deal-fee-shots { grid-column: 1 / -1; }
.neg-deal .link-btn { justify-self: start; display: inline-flex; align-items: center; gap: 2px; }
.neg-deal .deal-foot { display: flex; align-items: center; gap: 10px; padding-top: 10px; }
.neg-deal .deal-err { color: var(--red); font-size: 12px; }
.deal-fee-v + .deal-fee-v::before { content: ' · '; color: var(--muted); }
.deal-shots-v { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.scan-frame.wide { inset: 30% 10%; }
.lead-drop-by { margin: 2px 0 6px; }
.cfg-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cfg-h .lead-h { margin: 0; }
.cfg-toggle { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; }
.cfg-toggle:hover { color: var(--text-2); }
.neg-page .config-row .config-cat { color: var(--text); }
.neg-title-row { min-width: 0; }
.neg-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neg-title-row .badge { flex: none; }
.cfg-h .cfg-title { font-size: 14px; color: var(--text); }
.ui-tip.wrap { white-space: normal; max-width: min(420px, calc(100vw - 16px)); }
.neg-ask { font-size: 15px; font-weight: 600; }
.config-total-row .config-est { display: inline-flex; align-items: center; gap: 8px; }
.cfg-toggle { opacity: .75; }
/* 桌面扫码：按钮下方小浮窗，不遮住页面 */
.url-row { position: relative; }
.scan-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 320px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 8px; }
.scan-pop .scan-view { aspect-ratio: 4 / 3; }
.scan-pop-foot { display: flex; align-items: center; gap: 8px; padding-top: 6px; font-size: 12px; }
.scan-pop-foot .spacer { flex: 1; }
.scan-pop-foot .link-btn { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.scan-pop-foot kbd { font-size: 10px; }
.neg-layout.no-side { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.drop-anchor { position: relative; display: inline-block; }
.drop-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 300px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 8px; display: grid; gap: 8px; }
.drop-pop-top { display: flex; align-items: center; gap: 6px; }
.drop-pop-top .spacer { flex: 1; }
.drop-err { color: var(--red); font-size: 12px; }
.drop-pop .choice-chips { flex-wrap: wrap; }
.drop-pop .drop-note { height: 28px; font-size: 13px; }
.cfg-toggle { font-size: 11px; opacity: .55; }
.cfg-toggle:hover { opacity: .9; }
.config-total-row .config-est b { font-size: 16px; }
.config-total-row .config-name { opacity: .6; }
.kbd-hint { margin-left: 6px; font-family: inherit; font-size: 10px; line-height: 1; padding: 2px 4px; border: 1px solid var(--line); color: var(--muted); background: none; }
.scan-pop-err { margin: 4px 2px 8px; font-size: 13px; color: var(--text-2); }
/* 截图区：去掉虚线框，整齐一点 */
.shot-group, .shot-group.on { border: 0; padding: 0; margin: 0; }
.shot-group > label { transition: none; }
.shot-group.on > label { color: var(--text); }
.thumbs .add { border: 1px solid var(--line); background: var(--panel); }
.thumbs .add:hover { border-color: var(--line-strong); color: var(--text-2); }
.thumbs { position: relative; }
.thumbs.drag-over { outline: 1px solid var(--primary); outline-offset: 3px; background: var(--primary-soft); }
.phone-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 10px; width: 300px; }
.phone-pop img, .phone-pop-qr { width: 132px; height: 132px; flex: none; background: var(--gray-soft); }
.phone-pop-r { display: grid; gap: 6px; justify-items: start; }
.phone-pop-r p { margin: 0; font-size: 13px; }
.shot-inbox { border: 1px solid var(--line); background: var(--panel); }
/* 手机传图页：两组分别传 */
.shots-group { margin-bottom: 18px; }
.shots-group h3 { font-size: 14px; margin: 0 0 8px; }
.shots-group .thumbs .th, .shots-group .thumbs .add { width: 76px; height: 76px; }
/* 看大图：点哪里都关（iOS 需要 cursor:pointer 才会响应点击） */
@media (hover: none) { .img-view { cursor: pointer; } }
.shots-big { display: flex; align-items: center; justify-content: center; gap: 8px; height: 96px; margin-bottom: 10px; border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary); font-size: 15px; cursor: pointer; }
.shots-big .ic { width: 22px; height: 22px; }
/* 夜间模式的二维码：不反色（有的扫码器不认反色码），整体压暗、留浅色静区，不刺眼也能扫 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.neg-qr, .phone-pop img, .qr-box img, .lead-qr-inline img) { filter: brightness(.68) contrast(1.2); }
  :root:not([data-theme="light"]) .neg-qr { border-color: transparent; background: transparent; padding: 0; }
  :root:not([data-theme="light"]) .neg-qr img { width: 72%; margin: 0 auto; }
}
:root[data-theme="dark"] :is(.neg-qr, .phone-pop img, .qr-box img, .lead-qr-inline img) { filter: brightness(.68) contrast(1.2); }
:root[data-theme="dark"] .neg-qr { border-color: transparent; background: transparent; padding: 0; }
:root[data-theme="dark"] .neg-qr img { width: 72%; margin: 0 auto; }
.lead-lock-line.other { color: var(--text-2); }
.shot-up.thumbs .th, .shot-up.thumbs .add { width: 64px; height: 64px; }

/* 谈判页：成交表单展开时，上方不要分割线 */
.neg-ops:has(+ .neg-deal) { border-bottom: 0; padding-bottom: 0; }

/* 仅超级管理员可见的标记 */
.role-ic.so-ic, .stock-stats .role-ic.so-ic { color: var(--green); vertical-align: -2px; margin-left: 3px; display: inline-flex; }
.so-ic .ic { width: 12px; height: 12px; }

/* 价格表「一览」：五大件只读、多栏紧凑 */
.price-glance { column-width: 210px; column-gap: 20px; column-rule: 1px solid var(--line); padding: 6px 10px 8px; background: var(--panel); border: 1px solid var(--line); }
.pg-col { display: contents; }
.pg-col h3 { margin: 10px 0 2px; font-size: 12px; font-weight: 600; color: var(--text-2); break-after: avoid; }
.pg-col:first-child h3 { margin-top: 0; }
.pg-row { break-inside: avoid; display: flex; gap: 8px; font-size: 12px; line-height: 19px; }
.pg-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-p { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.pg-gap { height: 8px; }

/* 价格表行备注：型号后一个小灰点，悬停看内容；右键编辑 */
.hw-note-mark { flex-shrink: 0; display: inline-block; width: 4px; height: 4px; margin: 0 6px 0 4px; background: var(--muted); opacity: .8; cursor: help; vertical-align: 3px; }
.hw-note-pop { position: fixed; z-index: 60; width: 320px; padding: 8px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 6px 18px rgba(0,0,0,.14); display: grid; gap: 6px; }
.hw-note-foot { display: flex; align-items: center; gap: 6px; }
.hw-note-foot .spacer { flex: 1; }

/* 谈判页物品清单：谈判时改过的行（小灰方点，悬停看原值）、删掉的行（淡、划线） */
.config-row .cfg-mod { margin-left: 6px; }
.config-row.cfg-removed .config-name, .config-row.cfg-removed .config-est { color: var(--muted); text-decoration: line-through; }
.cfg-edit-foot { display: flex; align-items: center; gap: 10px; padding-top: 10px; }
.cfg-edit-foot .spacer { flex: 1; }
.cfg-edit-foot .deal-err { color: var(--red); font-size: 12px; }

/* 拆检入库 */
.insp-page { max-width: 1000px; }
.insp-title { font-size: 18px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.insp-meta { margin: 0 0 12px; }
.insp-rejected { margin: 0 0 12px; padding: 8px 10px; border-left: 2px solid var(--red); background: var(--panel); font-size: 13px; }
.insp-edit { display: grid; gap: 4px; margin: 8px 0 14px; }
.insp-row { display: grid; grid-template-columns: 96px minmax(0, 2fr) 64px minmax(0, 1fr) minmax(0, 1.2fr) 28px; gap: 6px; align-items: center; }
.insp-row .num, .insp-cmp-row .num { text-align: right; }
.insp-head { font-size: 12px; color: var(--muted); }
.insp-flag-in { color: var(--red); }
.insp-flag { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--red); }
.insp-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; }
.insp-foot .spacer { flex: 1; }
.insp-foot .deal-err { color: var(--red); font-size: 12px; }
.insp-loc { width: 160px; }
.insp-reject .input { width: 240px; }
.insp-cmp { display: grid; margin: 8px 0; background: var(--panel); border: 1px solid var(--line); }
.insp-cmp-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr) 110px; gap: 10px; align-items: center; padding: 5px 10px; font-size: 13px; }
.insp-cmp-row.ro { grid-template-columns: 96px minmax(0, 1fr); }
.insp-cmp-row + .insp-cmp-row:not(.cont) { border-top: 1px solid var(--line); }
.insp-cmp-row.diff > div:nth-child(2), .insp-cmp-row.diff > div:nth-child(3) { color: var(--orange, #b45309); }
.insp-cmp-row.diff { box-shadow: inset 2px 0 0 var(--orange); }
.insp-cmp-row .input { height: 26px; padding: 0 6px; }
.insp-total { border-top: 1px solid var(--line-strong) !important; }
.insp-extra { margin: 8px 0; }
@media (max-width: 720px) {
  .insp-row { grid-template-columns: 1fr 1fr; }
  .insp-cmp-row { grid-template-columns: 70px 1fr 1fr 80px; gap: 6px; }
  .insp-foot { flex-wrap: wrap; }
}
.cfg-edit.inspect .cfg-row { grid-template-columns: 84px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 24px; }
.cfg-edit.inspect .cfg-flag { color: var(--red); }
.insp-ttl { font-size: 15px; font-weight: 500; margin-left: 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-people { margin: 0 0 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.insp-people .ava { margin: 0 1px 0 2px; }
@media (max-width: 720px) { .cfg-edit.inspect .cfg-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px; } }
/* 入库表单：一个面板，底部按钮上方不要分割线 */
.item-form .form-foot { border-top: 0; margin-top: 12px; padding-top: 0; }
.insp-page .cfg-edit { margin-bottom: 14px; }

/* ---------- 消息页重做：少分割线，用间距和层次分区 ---------- */
.letters-page .page-head .seg-control button { height: calc(var(--ctrl-h) - 2px); min-height: 0; }
.letters-page .page-head .letter-new { height: var(--ctrl-h); min-height: var(--ctrl-h); padding: 0 12px; font-size: 13px; }
.letters-page .page-head .letter-new .ic { width: 16px; height: 16px; }

.letter-compose { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.lc-to { position: relative; display: flex; align-items: flex-start; gap: 10px; }
.lc-k { flex: none; font-size: 13px; color: var(--muted); line-height: 28px; }
.lc-chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lc-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 2px 0 5px; background: var(--gray-soft); font-size: 13px; color: var(--text); }
.lc-chip-x { border: 0; background: none; color: var(--muted); width: 20px; height: 20px; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.lc-chip-x:hover { color: var(--text); }
.lc-chip-x .ic { width: 13px; height: 13px; }
.lc-add { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 28px; min-width: 28px; padding: 0 6px; border: 1px dashed var(--line-strong); background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.lc-add:hover, .lc-add.on { color: var(--text); border-color: var(--text); border-style: solid; }
.lc-add .ic { width: 16px; height: 16px; }
.lc-add.wide { padding: 0 10px 0 6px; }
.lc-pop { left: 52px; top: calc(100% + 6px); width: min(400px, calc(100vw - 32px)); padding: 12px; display: flex; flex-direction: column; gap: 12px; z-index: 60; }
.lc-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-roles .filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 9px; }
.lc-roles .filter-chip .seg-n { font-style: normal; font-size: 11px; color: var(--muted); }
.lc-roles .filter-chip.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.lc-roles .filter-chip.on .seg-n { color: inherit; opacity: .7; }
.lc-roles .filter-chip.part { border-color: var(--text); color: var(--text); }
.lc-pop .people-grid { gap: 8px 6px; max-height: 260px; overflow-y: auto; }
.lc-pop-foot { display: flex; align-items: center; gap: 10px; }
.lc-pop-foot .spacer { flex: 1; }
textarea.lc-body, .letter-reply-form textarea.input { resize: none; overflow-y: auto; line-height: 1.55; padding-top: 6px; padding-bottom: 6px; }
textarea.lc-body { min-height: 96px; max-height: 50vh; }
.lc-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.lc-foot .spacer { flex: 1; }
.lc-foot .check-row { margin: 0; font-size: 13px; }
.lc-foot .seg-control button { min-height: 26px; font-size: 12px; padding: 0 9px; }

.letter-expand { border-top: 0; padding: 2px 14px 12px 50px; }
.letter-expand .letter-body { margin-top: 0; }
.letter-replies { margin-top: 14px; gap: 10px; }
.letter-actions { border-top: 0; padding-top: 0; margin-top: 14px; gap: 10px; }
.letter-actions .btn .ic { width: 15px; height: 15px; }
.letter-recall { color: var(--muted); }
.letter-recall:hover:not(:disabled) { color: var(--red); }
.letter-reply-form { margin-top: 14px; align-items: flex-end; gap: 6px; }
.letter-reply-form textarea.input { min-height: 32px; max-height: 40vh; }
@media (max-width: 800px) {
  .letter-expand { padding-left: 14px; }
  .lc-pop { left: -4px; right: -4px; width: auto; }
  .letter-from > .muted.small { white-space: nowrap; }
  .letter-readers-mini > :nth-child(n+4) { display: none; }
  .letter-reply-form { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
  .letter-reply-form textarea.input { flex: 1 1 100%; }
}

/* 等待类时间：今天灰、昨天橙、前天及更早红 */
.wait-0 { color: var(--muted); }
.wait-1 { color: var(--orange); }
.wait-2 { color: var(--red); }

/* 时间筛选：小日历浮窗 */
.time-filter { position: relative; display: inline-flex; }
.time-filter .filter-chip { display: inline-flex; align-items: center; gap: 4px; }
.time-filter .filter-chip .ic { width: 13px; height: 13px; }
.tf-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; width: 236px; padding: 8px; background: var(--panel); border: 1px solid var(--line); }
.tf-presets { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 8px; }
.tf-presets button { border: 0; background: none; font: inherit; font-size: 12px; padding: 4px 0; cursor: pointer; color: var(--text-2); }
.tf-presets button + button { border-left: 1px solid var(--line); }
.tf-presets button.on { background: var(--gray-soft); color: var(--text); }
.tf-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.tf-head .icon-btn { width: 24px; height: 24px; }
.tf-next .ic { transform: scaleX(-1); }
.tf-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.tf-grid i { font-style: normal; font-size: 11px; color: var(--muted); text-align: center; padding: 2px 0; }
.tf-grid button { border: 0; background: none; font: inherit; font-size: 12px; height: 28px; cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; }
.tf-grid button:hover { background: var(--gray-soft); }
.tf-grid button.today { box-shadow: inset 0 0 0 1px var(--line-strong); }
.tf-grid button.future { color: var(--muted); }
.tf-grid button.mid { background: var(--primary-soft); }
.tf-grid button.start, .tf-grid button.end { background: var(--primary); color: #fff; }
.tf-tip { margin: 6px 0 0; text-align: center; }
.price-cats i { font-style: normal; font-size: 11px; margin-left: 3px; color: var(--muted); font-weight: 400; }
.tf-x { margin: 0 -5px 0 2px; padding: 0 4px; color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; }
.tf-x:hover { color: var(--text); }

/* 日志：每条一行，右侧箭头原地展开；普通日志与敏感操作同一表格 */
.log-bar { gap: 6px; }
.pick-chip { position: relative; display: inline-flex; }
.pick-chip .filter-chip { display: inline-flex; align-items: center; gap: 4px; }
.pick-chip .filter-chip .ic { width: 13px; height: 13px; }
.pick-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 140px; max-height: 320px; overflow-y: auto; padding: 4px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.pick-pop button { display: flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: 13px; text-align: left; padding: 5px 8px; cursor: pointer; color: var(--text-2); white-space: nowrap; }
.pick-pop button:hover, .pick-pop button.on { background: var(--gray-soft); color: var(--text); }
table.log-t { table-layout: fixed; }
.log-t col.c-time { width: 96px; }
.log-t col.c-who { width: 84px; }
.log-t col.c-kind { width: 88px; }
.log-t col.c-act { width: 64px; }
.log-t.sens col.c-kind { width: 112px; }
.log-t.sens col.c-act { width: 160px; }
.log-t th { white-space: nowrap; overflow: hidden; }
.log-t td { white-space: nowrap; vertical-align: middle; }
.log-t td.ell { overflow: hidden; text-overflow: ellipsis; }
.log-t td.log-act { text-align: right; padding-top: 2px; padding-bottom: 2px; }
.log-t td.log-act > div { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.log-tg-ph { width: 26px; flex: 0 0 26px; }
.log-t tr.open .log-tg .ic { transform: rotate(180deg); }
.log-t tr.open td { border-bottom-color: transparent; }
.log-t tr.log-more td { white-space: normal; padding-top: 0; vertical-align: top; }
.log-t .log-more .chg:first-child { margin-top: 0; }
.log-full { font-size: 13px; color: var(--text-2); word-break: break-all; }
.log-sub { font-size: 13px; }
.log-sub + .log-sub { margin-top: 4px; }
.log-more-btn { margin-top: 8px; }
@media (max-width: 640px) {
  .log-t col.c-time { width: 78px; }
  .log-t col.c-who { width: 56px; }
  /* 窄屏收起类型列，把位置让给内容 */
  .log-t col.c-kind, .log-t.sens col.c-kind { width: 0; }
  .log-t th:nth-child(3), .log-t tr:not(.log-more) > td:nth-child(3) { padding: 0; }
  .log-t.sens col.c-act { width: 120px; }
}

/* 随内容自动增高的文本框：不显示拖拽手柄 */
textarea.auto-grow { resize: none; overflow: hidden; min-height: var(--field-h, 32px); }
.neg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; }

/* ---------- 物品页（搜集 → 谈判 → 拆检审核 → 入库 同一页，照整机页的卡片样式） ---------- */
.uni-page .neg-main { display: grid; gap: 10px; align-content: start; }
.uni-page .neg-head, .uni-page .lead-band, .uni-page .neg-ops, .uni-page .neg-deal { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; }
.uni-page .lead-band:last-child { border-bottom: 1px solid var(--line); }
.uni-page .neg-head { display: grid; gap: 10px; }
.uni-page .neg-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.uni-page .neg-title-row .spacer { flex: 1; }
.uni-page .neg-title { font-size: 17px; margin: 0; min-width: 0; }
.uni-page .neg-code { font-size: 12px; }
.uni-page .neg-price-row { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; }
.uni-page .neg-price-row .neg-ask { font-size: 14px; }
.uni-page .neg-ops .lead-ops { margin: 0; }
.lead-steps { display: flex; flex-wrap: wrap; border: 1px solid var(--line); background: var(--panel-2); }
.lead-step { padding: 4px 12px; display: grid; min-width: 86px; font-size: 12px; line-height: 1.5; }
.lead-step + .lead-step { border-left: 1px solid var(--line); }
.lead-step .k { color: var(--muted); }
.lead-step .v { display: flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--line-strong); font-variant-numeric: tabular-nums; }
.lead-step.done .v { color: var(--text); }
.lead-step.cur { background: var(--panel); box-shadow: inset 0 -2px 0 var(--primary); }
.lead-step.cur .k, .lead-step.cur .v { color: var(--primary-text); }
.lead-step.end .k, .lead-step.end .v { color: var(--red); }
.insp-panel .insp-cmp-row { grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr) 96px 96px; }
.insp-panel .insp-cmp-row.ro { grid-template-columns: 84px minmax(0, 1fr); }
.insp-panel .insp-cmp-row .input { width: 84px; margin-left: auto; text-align: right; }
.insp-cmp-row.miss > div:nth-child(3) { color: var(--muted); }
.insp-sum { display: grid; gap: 2px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.insp-proxy { display: flex; align-items: center; gap: 5px; margin: 0 0 6px; padding: 6px 10px; font-size: 13px; color: var(--orange-text); background: var(--orange-faint); border: 1px solid var(--orange-line); }
.insp-panel .thumbs { margin-top: 8px; }
.lead-tiles button.quiet b { color: var(--muted); }
@media (max-width: 760px) {
  .insp-panel .insp-cmp-row { grid-template-columns: 64px 1fr 1fr 76px; }
  .insp-panel .insp-cmp-row > div:nth-child(5) { display: none; }
}
.uni-page .neg-head + .neg-ops { margin-top: -11px; border-top: 0; padding-top: 0; }
.uni-page .neg-price-row { margin: 0; }
@media (min-width: 1100px) { .main:has(.uni-page) { --main-max: 1180px; } }
.uni-page { max-width: none; }
.lead-step { flex: 1 1 0; }
.nowrap { white-space: nowrap; }
.cfg-shots { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; margin: -2px 0 4px; }
.cfg-shots.need .add { border-color: var(--orange); }
.insp-row-shots { margin-top: 4px; }
.insp-row-shots .th, .insp-row-shots .add { width: 40px; height: 40px; }
.list-cell { white-space: nowrap; }
.list-cell .input { width: 76px; height: 26px; padding: 0 6px; text-align: right; margin-right: 4px; }
.lead-h-row .spacer { flex: 1; }

/* 到货情况：两行小格（标题 + 小字说明） */
.choice-chips.ship-chips button { height: auto; padding: 4px 10px; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; text-align: left; }
.choice-chips.ship-chips button small { font-size: 11px; color: var(--muted); }
.choice-chips.ship-chips button.on small { color: inherit; opacity: .75; }

/* 物品页：面板标题大一号；成交与收支一行数字格 */
.uni-page .lead-h { font-size: 14px; color: var(--text); letter-spacing: 0; }
.uni-page .lead-h .muted { font-size: 13px; font-weight: 400; }
.deal-strip { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0; border: 1px solid var(--line); }
.deal-strip > div { padding: 8px 10px; border-left: 1px solid var(--line); }
.deal-strip > div:first-child { border-left: 0; }
.deal-strip b.strong { font-weight: 700; }
.deal-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* 售出在途批量处理（易用性 2026-10-30） */
.batch-bar { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0 0 6px; }
.stock-table th.pick, .stock-table td.pick { width: 28px; padding-right: 0; cursor: pointer; }
.pick-box { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid var(--line-strong); background: var(--panel); vertical-align: middle; }
.pick-box.on { background: var(--text); border-color: var(--text); color: var(--panel); }
.pick-box .ic, .pick-box svg { width: 14px; height: 14px; }

/* 手机录入：没填的部件行压成一行（部件名、型号、估价同行），省一半高度（易用性 2026-10-30） */
@media (max-width: 700px) {
  .cfg-edit:not(.inspect) .cfg-row:not(.filled):not(.cfg-total):not(.cfg-head) { grid-template-columns: 76px minmax(0, 1fr) 80px; padding: 3px 6px; }
  .cfg-edit:not(.inspect) .cfg-row:not(.filled):not(.cfg-total):not(.cfg-head) .cfg-cat { grid-column: auto; }
  .cfg-edit:not(.inspect) .cfg-row:not(.filled):not(.cfg-total):not(.cfg-head) .cfg-del { display: none; }
}
/* 快捷登录：头像下方预留了报错行，上方补同高，让头像块在空白里垂直居中 */
.login-quick-wrap::before { content: ''; height: 18px; flex-shrink: 0; }
/* 登录页「在手机上登录」浮窗：桌面端贴在卡片右侧，顶边、底边与登录卡片对齐 */
@media (min-width: 701px) {
  .login .login-foot-row .phone-qr.login-phone-inline { position: static; }
  .login .login-foot-row .phone-qr-pop.right {
    top: -1px; bottom: -1px; left: calc(100% + 12px); right: auto; transform: none;
    justify-content: center; box-sizing: border-box;
  }
}
