:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e5eaf2;
  --border-strong: #d6dfeb;
  --text: #1a2233;
  --text-2: #5c6b82;
  --text-3: #8b98ab;
  --primary: #1d4ed8;
  --primary-hover: #1a45c2;
  --primary-soft: #e9efff;
  --primary-dark: #163ba8;
  --accent: #f59e0b;
  --success: #15a34a;
  --success-soft: #e7f7ed;
  --warning: #d97706;
  --warning-soft: #fff6e8;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --info: #0891b2;
  --info-soft: #e5f7fb;
  /* 分级阴影：越靠上的层级越轻，营造柔和的层次感 */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .05), 0 1px 2px rgba(16, 24, 40, .03);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .04);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --radius: 12px;
  --radius-sm: 8px;
  /* 控件统一尺度：桌面 38 / 紧凑 32，移动端在媒体查询里放大到 44 / 40 */
  --ctl-h: 38px;
  --ctl-h-sm: 32px;
  --ctl-r: 10px;
  --ctl-r-sm: 8px;
  --radius-lg: 16px;
  --pill: 999px;
  --ctl-chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  --search-icon: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b98ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E");
  --ring: 0 0 0 3px rgba(29, 78, 216, .12);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
::selection { background: rgba(29, 78, 216, .16); }
/* 细软滚动条，桌面端更精致 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a8b4c6; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
/* 键盘聚焦可见性（鼠标点击不显示轮廓） */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- boot ---------- */
.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-2);
}
.boot-mark {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #2563eb, #1239a4);
  color: #fff;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
  box-shadow: 0 12px 30px rgba(29, 78, 216, .28);
}
.boot-logo {
  width: min(220px, 62vw);
  height: auto;
}
.boot-title { font-size: 17px; font-weight: 600; color: var(--text); margin-top: 6px; }
.boot-sub { font-size: 13px; }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
}
.login-hero {
  background: linear-gradient(150deg, #10275f 0%, #1d4ed8 55%, #3b82f6 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-hero::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -180px; bottom: -220px;
  border-radius: 50%;
  border: 70px solid rgba(255,255,255,.07);
}
.hero-main { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; position: relative; z-index: 1; margin-bottom: 28px; }
.hero-logo { width: 300px; max-width: 100%; height: auto; display: block; }
.hero-copy h1 { font-size: 40px; line-height: 1.25; margin: 0 0 18px; font-weight: 700; }
.hero-copy p { font-size: 15px; opacity: .82; max-width: 420px; margin: 0; }
.hero-features { display: grid; gap: 12px; margin-top: 34px; }
.hero-features div { display: flex; align-items: center; gap: 10px; font-size: 14px; opacity: .9; }
.hero-features i { width: 6px; height: 6px; border-radius: 50%; background: #93c5fd; }
.hero-foot { font-size: 12px; opacity: .6; position: absolute; left: 60px; bottom: 56px; z-index: 1; }

.login-panel { display: grid; place-items: center; padding: 40px 28px; }
.login-card { width: 100%; max-width: 396px; }
.mobile-login-logo { display: none; }
.login-card h2 { font-size: 26px; margin: 0 0 6px; }
.login-card .sub { color: var(--text-2); margin: 0 0 28px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #344054; margin-bottom: 7px; }
.check-line { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 500 !important; color: var(--text) !important; cursor: pointer; }
.check-line input { width: 16px; height: 16px; accent-color: var(--primary); }
.field input, .field select, .field textarea, .input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--ctl-r);
  background: #fff;
  padding: 8px 12px;
  min-height: var(--ctl-h);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
/* 下拉框：全系统统一自绘箭头与右侧留白，避免各浏览器原生样式不一致 */
select:not([multiple]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--ctl-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  padding-right: 32px;
  cursor: pointer;
  text-overflow: ellipsis;
}
select:not([multiple])::-ms-expand { display: none; }
select:not([multiple]):disabled { background-color: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
/* 日期 / 搜索框：对齐与 iOS 原生外观归一 */
input[type="date"].input,
.field input[type="date"] { min-width: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
input[type="date"]::-webkit-datetime-edit { padding: 0; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
/* 紧凑控件（筛选栏 / 弹窗内小表单） */
.input.sm, .select.sm, .btn.sm {
  min-height: var(--ctl-h-sm);
  border-radius: var(--ctl-r-sm);
  font-size: 12.5px;
  padding: 5px 11px;
}
select.input.sm, select.select.sm { padding-right: 30px; }
/* 统一搜索框：左侧放大镜 + 留白，和全局搜索保持同一视觉语言 */
.input.search-input, .field input.search-input {
  padding-left: 34px;
  background-image: var(--search-icon);
  background-repeat: no-repeat;
  background-position: 11px center;
  background-size: 15px 15px;
}
.field input:hover, .field select:hover, .field textarea:hover,
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit input { flex: 1; min-width: 0; }
.input-unit .unit { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.login-switch { margin-top: 22px; text-align: center; color: var(--text-2); font-size: 13px; }
.login-switch button { background: none; border: 0; color: var(--primary); font-weight: 600; padding: 0 2px; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-row button { flex: 0 0 auto; }
.form-error {
  background: var(--danger-soft); color: #a51d1d;
  border-radius: 8px; padding: 9px 11px; font-size: 13px; margin-bottom: 14px;
}
.form-note {
  background: var(--info-soft); color: #0e6c85;
  border-radius: 8px; padding: 9px 11px; font-size: 13px; margin-bottom: 14px;
}
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.ret-list { display: grid; gap: 10px; max-height: 260px; overflow-y: auto; }
.ret-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.side-brand {
  min-height: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
}
.side-brand-link { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.side-logo { width: auto; max-width: 118px; max-height: 44px; height: auto; display: block; }
.side-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #2563eb, #1239a4);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.side-nav { padding: 12px 10px 6px; flex: 1; overflow-y: auto; }
.nav-group {
  padding: 15px 10px 5px; font-size: 10.5px; font-weight: 700;
  color: #9aa6b8; letter-spacing: .8px;
}
.nav-group:first-child { padding-top: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 2px;
  border-radius: 8px; color: #4a5a70; font-weight: 500;
  background: transparent; border: 0; width: 100%; text-align: left;
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; transition: transform .15s var(--ease); }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item:active svg { transform: scale(.94); }
.nav-item.active {
  background: var(--primary-soft); color: var(--primary); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}
.side-foot { padding: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.user-chip b { display: block; font-size: 13px; }
.user-chip small { color: var(--text-3); font-size: 11px; }

.main { flex: 1; min-width: 0; }
.topbar {
  height: 64px; background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16.5px; margin: 0; letter-spacing: -.01em; font-weight: 700; }
.topbar .crumb { color: var(--text-3); font-size: 11.5px; margin-top: 1px; letter-spacing: .01em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.topbar-user .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.topbar-user .avatar.name-badge { width: auto; height: 30px; padding: 0 12px; border-radius: 9px; white-space: nowrap; font-size: 13px; }
.logout-btn { font-size: 12px; padding: 6px 10px; color: var(--text-2); }
.logout-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
/* 用 .btn.mobile-menu 提高优先级，避免被 .btn 的 display:inline-flex 覆盖而在桌面端露出 */
.btn.mobile-menu { display: none; }
/* 超宽屏限制内容宽度并居中，避免表格被拉得过散 */
.view { padding: 24px 28px 48px; max-width: 1680px; margin: 0 auto; width: 100%; }

/* ---------- generic ---------- */
.btn {
  border: 1px solid var(--border); background: #fff; color: #334155;
  padding: 8px 14px; border-radius: var(--ctl-r); font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--ctl-h);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(29, 78, 216, .18); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--ctl-r-sm); min-height: var(--ctl-h-sm); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.015em; font-weight: 700; }
.page-head p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.emp-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.emp-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; color: var(--text-2); font-size: 14px; border-radius: 6px 6px 0 0; }
.emp-tab:hover { background: var(--surface-2); color: var(--text); }
.emp-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; background: var(--primary-soft); }

.emp-list-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px; box-shadow: var(--shadow-sm); }
.emp-list-item { align-items: center; }
.emp-row-main { flex: 1; min-width: 0; }
.emp-row-title { display: flex; align-items: center; gap: 6px; }
.emp-row-title b { font-size: 13px; }
.emp-row-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.emp-row-meta { display: flex; gap: 4px 14px; flex-wrap: wrap; margin-top: 5px; color: var(--text-2); font-size: 12px; }
.emp-row-meta span { white-space: nowrap; }
.emp-row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.card { background: var(--surface); border: 1px solid #e9eef6; border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.card-head small { color: var(--text-3); font-size: 12px; }
.card-body { padding: 18px; }

/* ---------- 组织架构 ---------- */
.org-card { overflow: hidden; }
.org-note { background: var(--primary-soft); color: var(--text-2); border-radius: 9px; padding: 10px 14px; font-size: 12px; line-height: 1.6; margin-bottom: 20px; }
.org-chart { display: flex; flex-direction: column; align-items: center; }
.org-tier { width: 100%; display: flex; justify-content: center; gap: 24px; }
.org-node { width: 260px; max-width: 100%; background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.org-node.top { border-top-color: var(--danger); }
.org-node.deputy { border-top-color: #7c4dcc; }
.org-node-label { text-align: center; font-weight: 700; font-size: 14px; padding: 10px 12px 6px; color: var(--text); }
.org-connector { width: 2px; height: 24px; background: var(--border); position: relative; }
.org-connector::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--border); transform: translateX(-50%); }
.org-branch { position: relative; width: min(680px, 100%); height: 26px; }
.org-branch::before { content: ''; position: absolute; top: 0; left: 16.66%; right: 16.66%; border-top: 2px solid var(--border); }
.org-branch i { position: absolute; top: 0; width: 2px; height: 26px; background: var(--border); }
.org-branch i:nth-child(1) { left: 16.66%; }
.org-branch i:nth-child(2) { left: 50%; }
.org-branch i:nth-child(3) { left: 83.33%; }
.org-depts { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.org-dept { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.org-dept-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; background: var(--primary-soft); border-bottom: 1px solid var(--border); }
.org-dept-head b { font-size: 14px; }
.org-dept-head span { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.org-dept-body { padding: 8px 10px 12px; }
.org-members { display: flex; flex-direction: column; gap: 6px; }
.org-member { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 9px; border: 1px solid #eef1f6; border-radius: 9px; min-width: 0; }
.org-member.inactive { opacity: .6; }
.org-avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.org-member-main { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: center; }
.org-member-main b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.org-member-main span { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.org-empty { text-align: center; color: var(--text-3); font-size: 12px; padding: 16px 8px; border: 1px dashed var(--border); border-radius: 9px; }
.org-unassigned { margin-top: 22px; border-top: 1px dashed var(--border); padding-top: 16px; }
.org-unassigned-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; }
.org-unassigned-head span { color: var(--text-3); font-size: 12px; }
.org-unassigned .org-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid #e9eef6; border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-xs);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.stat:hover { box-shadow: var(--shadow-sm); border-color: #dde5f0; transform: translateY(-1px); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-label { color: var(--text-2); font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 32px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: -.7px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-foot { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
/* 工作台：主指标用大卡（4 张或 3 张，按角色由 cols-* 固定列数，保证整行铺满），
   次指标用一条通栏数字条，不再出现「最后一张卡孤零零占一行」 */
.stat-grid.dashboard-stat-grid { margin-bottom: 12px; }
.stat-grid.dashboard-stat-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid.dashboard-stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-strip {
  display: flex; flex-wrap: wrap;
  background: #fff; border: 1px solid #e9eef6; border-radius: var(--radius);
  box-shadow: var(--shadow-xs); margin-bottom: 18px; overflow: hidden;
}
.stat-strip-item { flex: 1 1 0; min-width: 0; padding: 13px 18px; position: relative; }
.stat-strip-item + .stat-strip-item::before {
  content: ''; position: absolute; left: 0; top: 13px; bottom: 13px; width: 1px; background: var(--border);
}
.stat-strip-label { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-strip-value {
  font-size: 20px; font-weight: 700; letter-spacing: -.4px; margin-top: 2px;
  font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap;
}
.stat-strip-value small { font-size: 11.5px; font-weight: 500; color: var(--text-3); margin-left: 4px; }

.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
/* 栅格子项默认 min-width:auto，内部宽表格会把轨道撑开、反过来挤压另一列 */
.grid-2 > * { min-width: 0; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: 260px; }
.toolbar .select { width: 140px; }
.toolbar .filter-region { width: 164px; }
.toolbar .grow { flex: 1; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e9eef6; border-radius: var(--radius); box-shadow: var(--shadow-xs); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th {
  text-align: left; font-size: 11.5px; color: #8592a6; font-weight: 600;
  background: #f7f9fc; padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--border); letter-spacing: .02em;
}
td { padding: 11px 14px; border-bottom: 1px solid #eff2f7; font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr {
  cursor: pointer;
  transition: background .12s var(--ease);
}
tbody tr:hover { background: #f7faff; }
.cell-main { font-weight: 700; color: var(--text); }
.cell-sub { color: var(--text-3); font-size: 12px; }
.nowrap { white-space: nowrap; }
/* 金额、数量等数字使用等宽数字，纵向对齐更整齐 */
td b, .nowrap, .stat-value, .cockpit-num, .sales-stat-qty { font-variant-numeric: tabular-nums; }
/* 客户列表：序号列与可点击排序表头 */
.seq-cell { color: var(--text-3); font-variant-numeric: tabular-nums; width: 56px; text-align: center; }
th.sortable { cursor: pointer; user-select: none; transition: color .15s, background .15s; }
th.sortable:hover { color: var(--primary); background: var(--primary-soft); }
th.sortable.sorted { color: var(--primary); }
/* 排序箭头默认隐藏，只在悬停或已排序时出现，减少表头噪点 */
.sort-mark { color: #b6c0cf; font-size: 10px; margin-left: 4px; font-weight: 400; opacity: 0; transition: opacity .15s var(--ease); }
th.sortable:hover .sort-mark { opacity: 1; }
th.sortable.sorted .sort-mark { opacity: 1; color: var(--primary); }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.45; white-space: nowrap; }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.cyan { background: var(--info-soft); color: var(--info); }
.badge.purple { background: #f1eafe; color: #7c4dcc; }
.badge.gray { background: #eef1f5; color: var(--text-2); }
.empty { text-align: center; padding: 46px 16px; color: var(--text-3); }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; }

/* 员工资料库 */
.kb-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.kb-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 20px; font-size: 13px; cursor: pointer; transition: all .15s; }
.kb-tab:hover { border-color: var(--primary); color: var(--primary); }
.kb-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.kb-tab-cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0,0,0,.06); font-size: 11px; }
.kb-tab.active .kb-tab-cnt { background: rgba(255,255,255,.25); }
.kb-tabs-spacer { flex: 1; }

/* 员工资料入口卡：桌面四列、平板/手机两列；点击卡片切换分类并定位到内容区 */
.kb-entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kb-entry-card {
  min-width: 0; min-height: 112px; padding: 14px 15px;
  display: flex; flex-direction: column; align-items: stretch; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); overflow: hidden;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.kb-entry-card:not(.active):hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.kb-entry-card:active { transform: translateY(0); }
.kb-entry-card.active { border-color: var(--primary); box-shadow: var(--ring), var(--shadow-sm); }
.kb-entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.kb-entry-title { min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--text-2); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-entry-icon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kb-entry-icon svg { width: 16px; height: 16px; }
.kb-entry-card.tone-success .kb-entry-icon { background: var(--success-soft); color: var(--success); }
.kb-entry-card.tone-info .kb-entry-icon { background: var(--info-soft); color: var(--info); }
.kb-entry-card.tone-warning .kb-entry-icon { background: var(--warning-soft); color: var(--warning); }
.kb-entry-value { display: flex; align-items: baseline; gap: 4px; margin-top: 10px; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kb-entry-value small { font-size: 11.5px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.kb-entry-foot { margin-top: 4px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-entry-admin { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
/* 顶栏 sticky 64px，定位内容时留出间距，避免标题被顶栏遮住 */
.knowledge-content { scroll-margin-top: 80px; }

@media (max-width: 900px) {
  .kb-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kb-entry-card { min-height: 102px; padding: 12px; }
  .kb-entry-icon { width: 26px; height: 26px; flex-basis: 26px; border-radius: 8px; }
  .kb-entry-icon svg { width: 14px; height: 14px; }
  .kb-entry-title { font-size: 12.5px; }
  .kb-entry-value { margin-top: 8px; font-size: 23px; }
  .kb-entry-foot { font-size: 11px; }
  .kb-entry-admin { justify-content: flex-start; }
}

@media (max-width: 360px) {
  .kb-entry-card { min-height: 96px; padding: 10px; }
  .kb-entry-title { font-size: 12px; }
  .kb-entry-foot { font-size: 10.5px; }
}

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.kb-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.kb-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.kb-card-head { padding: 15px 17px 11px; border-bottom: 1px solid var(--border); }
.kb-card-head h3 { margin: 0; font-size: 15px; line-height: 1.5; word-break: break-word; }
.kb-pin { display: inline-block; background: var(--warning-soft); color: var(--warning); font-size: 11px; padding: 2px 7px; border-radius: 10px; margin-right: 7px; vertical-align: 2px; }
.kb-card-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.kb-card-body { padding: 15px 17px; color: var(--text); font-size: 13.5px; line-height: 1.85; white-space: normal; word-break: break-word; flex: 1; }
.kb-card-body a { color: var(--primary); word-break: break-all; }
.kb-inline-img { display: block; max-width: 100%; height: auto; margin: 10px 0; border-radius: 8px; border: 1px solid var(--border); }
.kb-card-foot { padding: 10px 17px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 11.5px; }
/* 小标题卡片：只显示标题，点击弹窗看全文 */
.kb-doc-tile { min-height: 0; }
.kb-doc-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 15px 17px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.kb-doc-link:hover { background: var(--primary-soft, rgba(47,107,255,.05)); }
.kb-doc-title { font-size: 14px; font-weight: 600; line-height: 1.5; word-break: break-word; }
.kb-doc-arrow { flex: 0 0 auto; color: var(--text-3); font-size: 22px; line-height: 1; }
.kb-doc-link:hover .kb-doc-arrow { color: var(--primary); }
/* 全文弹窗 */
.kb-view-meta { color: var(--text-3); font-size: 12px; margin-bottom: 14px; }
.kb-view-meta .kb-pin { vertical-align: 1px; }
.kb-view-content { color: var(--text); font-size: 14px; line-height: 1.9; word-break: break-word; }
.kb-view-content a { color: var(--primary); word-break: break-all; }
/* 产品报价表（员工资料） */
.price-table { min-width: 900px; }
.price-table th button.link-btn { color: inherit; font-weight: 600; font-size: 11.5px; }
.price-table th button.link-btn:hover { color: var(--primary); }
.price-table td.price-content { white-space: normal; line-height: 1.6; color: var(--text-2); font-size: 12.5px; min-width: 300px; }
.price-table tbody tr { cursor: default; }
.price-auto-tag { display: inline-block; font-size: 10px; line-height: 1.4; padding: 1px 5px; border-radius: 4px; background: var(--primary-soft, #e8f7f7); color: var(--primary, #01a6aa); font-weight: 600; vertical-align: middle; margin-left: 2px; }
/* 产品系列标签栏 */
.price-series-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.price-series-tab { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 18px; font-size: 12.5px; cursor: pointer; transition: all .15s var(--ease); }
.price-series-tab:hover { border-color: var(--primary); color: var(--primary); }
.price-series-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.price-series-cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: rgba(0,0,0,.06); font-size: 10.5px; }
.price-series-tab.active .price-series-cnt { background: rgba(255,255,255,.25); }

.bar-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; }
.bar-row span:first-child { width: 72px; color: var(--text-2); }
.region-bar-row { margin: 2px 0; }
.region-bar-row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region-dist-card .card-head { padding: 10px 14px; }
.region-dist-card .card-body { padding: 10px 14px; }
.bar-track { flex: 1; height: 8px; background: #eef1f6; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 8px; }
.bar-row b { width: 30px; text-align: right; }
.region-bar-row b { width: 62px; white-space: nowrap; font-size: 12px; }

/* 销量统计：与报表中心一致的细蓝条，产品名与销量数值固定宽度，柱条自适应 */
.sales-stat-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 13px; }
.sales-stat-name { width: 130px; flex: 0 0 130px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-stat-row .bar-track { height: 8px; border-radius: 8px; }
.sales-stat-row .bar-fill { background: var(--primary); border-radius: 8px; }
.sales-stat-qty { width: 80px; flex: 0 0 80px; text-align: right; white-space: nowrap; }
.sales-stat-toolbar { align-items: center; }
.sales-stat-toolbar .stat-date-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.sales-stat-toolbar .stat-date-label .input { width: 150px; padding: 6px 8px; }

/* 客户统计筛选：员工 / 日期快捷范围 / 月季度年度趋势 */
.customer-stat-toolbar { align-items: center; }
.customer-stat-toolbar.sub { margin-top: -6px; }
.customer-stat-toolbar .stat-date-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.customer-stat-toolbar .stat-date-label .input,
.customer-stat-toolbar .stat-date-label .select { width: 150px; padding: 6px 8px; }
.customer-stat-toolbar .stat-owner-locked { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; white-space: nowrap; }
.customer-stat-toolbar .stat-divider { width: 1px; align-self: stretch; min-height: 24px; background: var(--border); margin: 0 2px; }
@media (max-width: 768px) {
  .sales-stat-row { gap: 8px; }
  .sales-stat-name { width: 96px; flex-basis: 96px; font-size: 12px; }
  .sales-stat-qty { width: 68px; flex-basis: 68px; font-size: 12px; }
  .sales-stat-toolbar .stat-date-label .input { width: 130px; }
  .customer-stat-toolbar { gap: 6px; flex-wrap: wrap; }
  .customer-stat-toolbar .btn.sm { padding: 4px 6px; font-size: 11px; }
  .customer-stat-toolbar .stat-date-label { gap: 4px; font-size: 11px; }
  .customer-stat-toolbar .stat-date-label:not(.stat-owner-label) { flex: 0 0 auto; min-width: 0; }
  .customer-stat-toolbar .date-label-text { display: inline; font-size: 10px; color: var(--text-3); }
  .customer-stat-toolbar .stat-date-label .input { width: 58px; min-width: 0; padding: 3px 4px; font-size: 10px; }
  .customer-stat-toolbar .stat-owner-label { width: 100%; flex: 0 0 100%; }
  .customer-stat-toolbar .stat-owner-label .select { width: auto; flex: 1; min-width: 0; padding: 5px 6px; }
  .customer-stat-toolbar .grow { display: none; }
  .customer-stat-toolbar .btn.ghost { display: none; }
  .customer-stat-toolbar .stat-divider { display: none; }
  .customer-stat-toolbar .stat-owner-locked { width: 100%; flex: 0 0 100%; }
  .customer-stat-toolbar.sub { flex-wrap: wrap; }
  .customer-stat-toolbar.sub .stat-date-label:first-child { display: none; }
  .customer-stat-toolbar.sub .cell-sub { display: none; }
  /* 客户统计四张卡片：手机端压缩后一行展示 */
  .stat-grid.customer-stat-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
  .customer-stat-grid .stat { padding: 8px 6px; border-radius: 9px; box-shadow: none; min-width: 0; }
  .customer-stat-grid .stat-top { display: flex; justify-content: space-between; align-items: center; gap: 3px; }
  .customer-stat-grid .stat-icon { width: 20px; height: 20px; border-radius: 5px; flex: 0 0 20px; }
  .customer-stat-grid .stat-icon svg { width: 12px; height: 12px; }
  .customer-stat-grid .stat-label { display: block; flex: 1; min-width: 0; font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .customer-stat-grid .stat-value { font-size: 17px; line-height: 1.2; margin-top: 6px; letter-spacing: -.5px; white-space: nowrap; }
  .customer-stat-grid .stat-foot { font-size: 9px; line-height: 1.2; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 工作台主指标：手机端两列，数字看得清；次指标条自动折行铺满 */
  .stat-grid.dashboard-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
  .stat-grid.dashboard-stat-grid.cols-4,
  .stat-grid.dashboard-stat-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .dashboard-stat-grid .stat { padding: 12px 13px; border-radius: 11px; box-shadow: none; min-width: 0; }
  .dashboard-stat-grid .stat-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
  .dashboard-stat-grid .stat-icon { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px; }
  .dashboard-stat-grid .stat-icon svg { width: 14px; height: 14px; }
  .dashboard-stat-grid .stat-label { display: block; flex: 1; min-width: 0; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dashboard-stat-grid .stat-value { font-size: 21px; line-height: 1.2; margin-top: 8px; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dashboard-stat-grid .stat-foot { font-size: 11px; line-height: 1.3; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 次指标：手机上拆成 2 列小格，最后一张铺满整行 */
  .stat-strip {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    background: transparent; border: 0; box-shadow: none; overflow: visible;
    margin-bottom: 14px;
  }
  .stat-strip-item {
    flex: none; padding: 10px 12px; background: #fff;
    border: 1px solid #e9eef6; border-radius: 10px; box-shadow: var(--shadow-xs);
  }
  .stat-strip-item + .stat-strip-item::before { display: none; }
  .stat-strip-label { font-size: 11.5px; line-height: 1.4; }
  .stat-strip-value { font-size: 17px; margin-top: 1px; }
  .stat-strip-value small { display: none; }
  .stat-strip-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* 主指标为奇数张时（财务/销售角色），最后一张铺满整行，避免半格空着 */
  .dashboard-stat-grid .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* 其他页面的统计卡同理：奇数张最后一张铺满，不留半格；图标跟住文字，不飘到最右 */
  .stat-grid:not(.customer-stat-grid):not(.dashboard-stat-grid) .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat-grid:not(.customer-stat-grid):not(.dashboard-stat-grid) .stat:last-child:nth-child(odd) .stat-top { justify-content: flex-start; }
  .stat-grid:not(.customer-stat-grid):not(.dashboard-stat-grid) .stat:last-child:nth-child(odd) .stat-icon { margin-left: 8px; }
}
@media (max-width: 360px) {
  .customer-stat-grid { gap: 4px; }
  .customer-stat-grid .stat { padding: 6px 4px; }
  .customer-stat-grid .stat-icon { width: 17px; height: 17px; flex-basis: 17px; }
  .customer-stat-grid .stat-icon svg { width: 10px; height: 10px; }
  .customer-stat-grid .stat-label { font-size: 9px; }
  .customer-stat-grid .stat-value { font-size: 15px; }
  .customer-stat-grid .stat-foot { font-size: 8px; }
  .dashboard-stat-grid { gap: 6px; }
  .dashboard-stat-grid .stat { padding: 10px 11px; }
  .dashboard-stat-grid .stat-icon { width: 24px; height: 24px; flex-basis: 24px; }
  .dashboard-stat-grid .stat-icon svg { width: 13px; height: 13px; }
  .dashboard-stat-grid .stat-label { font-size: 11.5px; }
  .dashboard-stat-grid .stat-value { font-size: 19px; }
  .dashboard-stat-grid .stat-foot { font-size: 10.5px; }
  .customer-stat-toolbar .btn.sm { padding: 3px 4px; font-size: 10px; }
  .customer-stat-toolbar .date-label-text { font-size: 9px; }
  .customer-stat-toolbar .stat-date-label .input { width: 50px; font-size: 9px; }
}

.list { display: grid; }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid #eef1f6; }
.list-item:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: 0 0 9px; background: var(--primary); }
.list-item .li-main { flex: 1; min-width: 0; }
.li-main b { font-size: 13px; }
.li-main p { margin: 3px 0 0; color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.step { flex: 1; min-width: 82px; text-align: center; padding: 8px 6px; border-radius: 8px; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; border: 1px solid var(--border); }
.step.done { background: var(--success-soft); color: var(--success); border-color: #bfe6cd; }
.step.current { background: var(--primary-soft); color: var(--primary); border-color: #bcd0ff; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: #e6ebf3; }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -19px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.tl-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.tl-head b { font-size: 13px; }
.tl-item p { margin: 6px 0 0; font-size: 13px; color: #334155; white-space: pre-wrap; }

/* ---------- modal ---------- */
#modal-root:empty { display: none; }
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: min(720px, 100%);
  max-height: min(88vh, 900px); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: modal-in .18s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99) } to { opacity: 1; transform: none } }
.modal.small { width: min(460px, 100%); }
.modal-head { padding: 17px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }
.close-x {
  border: 0; background: var(--surface-3); width: 30px; height: 30px; border-radius: 8px;
  font-size: 18px; color: var(--text-2); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.close-x:hover { background: #e6ebf3; color: var(--text); }

/* ---------- global search ---------- */
.gs-shell { display: grid; gap: 10px; }
.gs-search { position: relative; display: flex; align-items: center; }
.gs-search-icon {
  position: absolute; left: 13px; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); pointer-events: none;
}
.gs-search-icon svg { width: 18px; height: 18px; }
.gs-input {
  width: 100%; height: var(--ctl-h); padding: 0 44px 0 42px;
  border: 1px solid var(--border-strong); border-radius: var(--ctl-r);
  background: var(--surface-2); color: var(--text); outline: none; font-size: 14px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.gs-input:focus { background: #fff; border-color: var(--primary); box-shadow: var(--ring); }
.gs-input::-webkit-search-cancel-button { display: none; }
.gs-clear {
  position: absolute; right: 8px; width: 28px; height: 28px;
  border: 0; border-radius: 8px; background: var(--surface-3);
  color: var(--text-2); font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.gs-clear:hover { background: #e2e8f0; color: var(--text); }
.gs-clear[hidden] { display: none; }
.gs-chips {
  display: flex; align-items: center; gap: 7px;
  overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 2px;
  scrollbar-width: none;
}
.gs-chips::-webkit-scrollbar { display: none; }
.gs-chip {
  flex: 0 0 auto; min-height: 30px; padding: 5px 11px;
  border: 1px solid var(--border); border-radius: var(--pill);
  background: var(--surface); color: var(--text-2);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.gs-chip:hover { border-color: var(--border-strong); color: var(--text); }
.gs-chip.active { background: var(--primary-soft); border-color: #bcd0ff; color: var(--primary); }
.gs-chip-count { margin-left: 5px; font-weight: 500; color: var(--text-3); }
.gs-chip.active .gs-chip-count { color: var(--primary); }
.gs-summary { font-size: 12px; color: var(--text-3); padding: 2px 2px 0; }
.gs-results { display: grid; gap: 2px; max-height: min(52vh, 460px); overflow-y: auto; padding-right: 2px; overscroll-behavior: contain; }
.gs-section + .gs-section { margin-top: 6px; }
.gs-section-title {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 8px 4px; font-size: 12px; font-weight: 700; color: var(--text-2);
}
.gs-section-title span:last-child { color: var(--text-3); font-weight: 500; }
.gs-result {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 50px; padding: 8px 10px; text-align: left;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.gs-result:hover, .gs-result.is-active { background: var(--surface-2); border-color: var(--border); }
.gs-result-icon {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.gs-result-icon svg { width: 16px; height: 16px; }
.gs-result-main { flex: 1 1 auto; min-width: 0; }
.gs-result-title, .gs-result-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-result-title { font-size: 13px; font-weight: 600; color: var(--text); }
.gs-result-sub { margin-top: 2px; font-size: 12px; color: var(--text-2); }
.gs-result mark { background: #fff2b8; color: inherit; padding: 0 1px; border-radius: 2px; }
.gs-result-arrow { flex: 0 0 auto; color: var(--text-3); font-size: 18px; line-height: 1; }
.gs-empty { padding: 34px 16px; text-align: center; color: var(--text-2); }
.gs-empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.gs-empty span { font-size: 12px; color: var(--text-3); line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.quote-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; background: var(--surface-2); }
.quote-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.quote-group-head .input { flex: 1; min-width: 0; }
.quote-group-head .btn { flex: 0 0 auto; }
.quote-line { display: grid; grid-template-columns: 2fr .8fr .9fr 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.quote-line:last-child { margin-bottom: 0; }
.quote-line .input { width: 100%; }
.quote-brief { display: grid; gap: 8px; }
.quote-brief-day { border-left: 2px solid var(--primary); padding-left: 8px; }
.quote-brief-date { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 3px; }
.quote-brief-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 12px; line-height: 1.5; }
.quote-brief-name { font-weight: 600; color: var(--text); }
.quote-brief-meta { font-size: 11px; color: var(--text-3); }
.region-select { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.region-select select { width: 100%; }
.region-select select:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
.detail-grid div { font-size: 13px; }
.detail-grid small { display: block; color: var(--text-3); font-size: 11px; margin-bottom: 2px; }
.detail-grid.settings-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.detail-grid.settings-detail-grid > div { min-width: 0; }
.detail-grid.settings-detail-grid small { display: block; color: var(--text-3); font-size: 11px; margin-bottom: 2px; }
.detail-grid.settings-detail-grid b { display: block; min-width: 0; font-weight: 600; color: var(--text); word-break: break-word; }
/* 客户详情弹窗：手机端也保持每行两项，减少右侧空白 */
.detail-grid.customer-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.detail-grid.customer-detail-grid > div { min-width: 0; }
.detail-grid.customer-detail-grid b { display: block; min-width: 0; font-weight: 600; color: var(--text); word-break: break-word; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 22px 0 10px; text-transform: none; }

/* ---------- toast ---------- */
#toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 8px; }
.toast {
  background: #1e293b; color: #fff; padding: 11px 15px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); font-size: 13px; max-width: 340px;
  animation: slide .18s var(--ease);
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
@keyframes slide { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- mobile ---------- */
.mobile-nav { display: none; }
.scrim { display: none; }
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid.customer-stat-grid { grid-template-columns: repeat(4, 1fr); }
  /* 工作台主指标交给 auto-fit 自适应列数，窄屏自然落到 2 列 */
  .grid-2, .grid-2.equal { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { padding: 34px 20px 40px; align-items: start; }
  .login-card { margin-top: 0; }
  .mobile-login-logo { display: block; width: 184px; max-width: 100%; height: auto; margin: 0 auto 26px; }
  .sidebar {
    width: 200px; flex-basis: 200px;
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 12px 0 30px rgba(15,23,42,.12);
  }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 25; }
  .btn.mobile-menu { display: inline-flex; }
  .topbar { padding: env(safe-area-inset-top, 0px) 16px 0; height: calc(60px + env(safe-area-inset-top, 0px)); }
  /* 手机端顶栏只留必要信息，避免右侧用户名被挤出屏幕 */
  .topbar .crumb { display: none; }
  .topbar h1 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar > div:first-child { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .topbar-right { flex: 0 0 auto; }
  .topbar-right > .btn span { display: none; }
  .topbar-right > .btn { padding: 7px; }
  .topbar-user { flex: 0 0 auto; }
  .topbar-right { gap: 8px; }
  .topbar-user .avatar.name-badge { height: 28px; padding: 0 9px; font-size: 12px; }
  .logout-btn span { display: none; }
  .logout-btn { padding: 7px; }
  .view { padding: 14px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .page-head { margin-bottom: 14px; gap: 8px; }
  /* 顶栏已经显示页面名，页内大标题重复，手机端省掉换成一屏内容 */
  .page-head h1 { display: none; }
  .page-head > div:first-child { flex: 1 1 100%; }
  .page-head p { font-size: 12.5px; }
  .page-head .actions { width: auto; gap: 8px; justify-content: flex-start; }
  .page-head .actions .btn { flex: 0 1 auto; white-space: nowrap; min-height: 36px; padding: 8px 12px; font-size: 13px; }
  /* 手机端触控目标放大，避免误触 */
  .btn { min-height: 40px; padding: 9px 14px; }
  .btn.sm { min-height: 34px; padding: 6px 10px; }
  .card-head { padding: 13px 15px; }
  /* 卡片标题不折行，右侧说明文字单行省略，避免「2026-12 工资 / 明细」这种断行 */
  .card-head h3 { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-head small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-body { padding: 15px; }
  /* 普通统计卡（非客户统计 4 列、非工作台 3 列）在手机端压缩，减少占屏 */
  .stat-grid:not(.customer-stat-grid):not(.dashboard-stat-grid) { gap: 10px; }
  .stat-grid:not(.customer-stat-grid):not(.dashboard-stat-grid) .stat { padding: 14px; }
  .stat-grid:not(.customer-stat-grid):not(.dashboard-stat-grid) .stat-value { font-size: 22px; }
  .stat-grid:not(.customer-stat-grid):not(.dashboard-stat-grid) .stat-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; }
  .emp-tabs { gap: 4px; }
  .emp-tab { flex: 1; padding: 8px 6px; font-size: 13px; }
  .emp-list-panel { padding: 4px 12px; }
  .emp-list-item { flex-wrap: wrap; }
  .emp-row-actions { width: 100%; justify-content: flex-start; padding-left: 46px; }
  .org-node { width: 100%; }
  .org-branch { display: none; }
  .org-depts { grid-template-columns: 1fr; gap: 12px; }
  .org-connector { height: 18px; }
  .org-note { margin-bottom: 14px; }
  .org-unassigned .org-members { grid-template-columns: 1fr; }
  /* 普通筛选栏在手机端排成两列，比逐项占满整行更紧凑 */
  .toolbar:not(.customer-stat-toolbar):not(.sales-stat-toolbar) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .toolbar:not(.customer-stat-toolbar):not(.sales-stat-toolbar) > .grow { display: none; }
  .toolbar:not(.customer-stat-toolbar):not(.sales-stat-toolbar) > .stat-owner-label { grid-column: 1 / -1; }
  .toolbar .input, .toolbar .select { width: 100%; }
  .toolbar .filter-region { width: 100%; flex: none; }
  .toolbar .stat-owner-label { display: flex; align-items: center; gap: 8px; }
  .toolbar .stat-owner-label .select { flex: 1 1 auto; width: auto; min-width: 0; }
  .toolbar:not(.customer-stat-toolbar):not(.sales-stat-toolbar) > .cell-sub {
    grid-column: 1 / -1; text-align: right;
  }
  .modal { max-height: 94vh; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .quote-line { grid-template-columns: 1fr 1fr; }
  .quote-line .btn { width: 100%; }
  /* iOS 上字号小于 16px 会在聚焦时自动放大整个页面 */
  .field input, .field select, .field textarea, .input, .select, .textarea { font-size: 16px; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(16, 24, 40, .05);
    z-index: 24; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-nav button {
    flex: 1; min-width: 0; min-height: 64px; border: 0; background: transparent; color: var(--text-3);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-size: 12px; font-weight: 600; padding: 6px 2px 4px;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav button svg { width: 26px; height: 26px; stroke-width: 2; }
  .mobile-nav button span { line-height: 1.2; white-space: nowrap; }
  .mobile-nav button.active { color: var(--primary); }
  .modal { max-height: 92vh; }
  #toast-root { top: auto; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); right: 12px; left: 12px; }
  .toast { max-width: none; }

  /* ---- 列表卡片化：带 data-label 的表格在手机上翻成卡片，消除横向滚动 ---- */
  .table-wrap[data-mobile-cards] { border: 0; background: transparent; box-shadow: none; }
  .table-wrap[data-mobile-cards] table { min-width: 0 !important; width: 100%; display: block; }
  .table-wrap[data-mobile-cards] thead { display: none; }
  .table-wrap[data-mobile-cards] tbody { display: block; }
  .table-wrap[data-mobile-cards] tr {
    display: flex; flex-direction: column;
    position: relative; margin-bottom: 10px; padding: 12px 14px;
    background: #fff; border: 1px solid #e9eef6; border-radius: 12px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow .15s var(--ease);
  }
  .table-wrap[data-mobile-cards] tr:active { box-shadow: var(--shadow); }
  .table-wrap[data-mobile-cards] td {
    display: flex; align-items: flex-start; gap: 10px; border: 0; padding: 6px 0;
    font-size: 13px; min-height: 28px;
  }
  /* 标题列（客户姓名/单号/商品名）提到卡片最上方 */
  .table-wrap[data-mobile-cards] td.cell-title { order: -1; }
  /* 值为「—」的占位行在手机上是个纯噪音，直接收起来 */
  .table-wrap[data-mobile-cards] td.td-empty { display: none; }
  .table-wrap[data-mobile-cards] td + td { border-top: 1px dashed #eef1f6; }
  .table-wrap[data-mobile-cards] td::before {
    content: attr(data-label); flex: 0 0 68px; color: var(--text-3);
    font-size: 12px; line-height: 1.6; padding-top: 1px;
  }
  .table-wrap[data-mobile-cards] td.seq-cell { display: none; }
  .table-wrap[data-mobile-cards] td:not([data-label])::before { content: none; }
  /* 首列（客户名/商品名）作为卡片标题突出 */
  .table-wrap[data-mobile-cards] td.cell-title {
    font-size: 15px; font-weight: 700; color: var(--text); padding-bottom: 9px;
  }
  .table-wrap[data-mobile-cards] td.cell-title::before { display: none; }
  /* 操作按钮行：顶对齐、允许换行 */
  .table-wrap[data-mobile-cards] td.cell-actions { padding-top: 10px; flex-wrap: wrap; }
  .table-wrap[data-mobile-cards] td.cell-actions .btn { min-height: 34px; }
  /* 空状态行不显示标签、居中 */
  .table-wrap[data-mobile-cards] tr.row-empty td { justify-content: center; }
  .table-wrap[data-mobile-cards] td[colspan]::before { content: none; }
  /* 报价单手机端：卡片只显示「报价日期 · 客户」一行，其余列保留给电脑版 */
  .table-wrap[data-mobile-cards].quote-list-wrap tr {
    display: flex; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px;
    padding: 14px;
  }
  .table-wrap[data-mobile-cards].quote-list-wrap td {
    display: none; border: 0; padding: 0; min-height: 0;
  }
  .table-wrap[data-mobile-cards].quote-list-wrap td.quote-date-cell,
  .table-wrap[data-mobile-cards].quote-list-wrap td.quote-customer-cell {
    display: inline-flex; align-items: baseline; gap: 6px;
    font-size: 14px; line-height: 1.5; border: 0; padding: 0; min-height: 0;
  }
  .table-wrap[data-mobile-cards].quote-list-wrap td.quote-date-cell { font-weight: 700; color: var(--text); }
  .table-wrap[data-mobile-cards].quote-list-wrap td.quote-date-cell::before { content: none; display: none; }
  .table-wrap[data-mobile-cards].quote-list-wrap td.quote-customer-cell { color: var(--text-2); }
  .table-wrap[data-mobile-cards].quote-list-wrap td.quote-customer-cell::before {
    content: '·'; display: inline; flex: none; color: var(--text-3); font-size: 13px;
  }
  .table-wrap[data-mobile-cards].quote-list-wrap tr.row-empty td[colspan] { display: block; }
  .table-wrap[data-mobile-cards].quote-list-wrap tr.row-empty td[colspan]::before { content: none; }
  /* 员工资料库 */
  .kb-tabs { gap: 6px; }
  .kb-tab { padding: 7px 12px; font-size: 12.5px; }
  .kb-tabs-spacer { flex-basis: 100%; height: 0; }
  .kb-grid { grid-template-columns: 1fr; gap: 10px; }
  .kb-card-body { font-size: 13px; }
  .kb-doc-link { padding: 14px; }
  .kb-doc-title { font-size: 13.5px; }
  .kb-view-content { font-size: 13.5px; }
  .kb-card-actions .btn { min-height: 34px; }

  /* ---- 产品报价表手机端：单行紧凑（序号 | 产品名 | 含量 | PH | 规格 | 吨价） ---- */
  .table-wrap.price-list-wrap table { width: 100% !important; min-width: 0 !important; display: block; }
  .table-wrap.price-list-wrap tbody { display: block; }
  .table-wrap.price-list-wrap tr {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 2.8fr) minmax(0, 0.95fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.32fr);
    align-items: center; column-gap: 4px;
    padding: 8px 9px; margin-bottom: 5px; border-radius: 9px; min-width: 0; width: 100%;
  }
  .table-wrap.price-list-wrap td {
    display: block !important; border: 0 !important; padding: 0 !important;
    min-height: 0 !important; min-width: 0 !important; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .table-wrap.price-list-wrap td::before { display: none !important; }
  /* 通用卡片化规则会把 cell-title 提到最前，报价表需保持 DOM 列序（序号|产品名|含量|PH|规格|吨价） */
  .table-wrap[data-mobile-cards].price-list-wrap td.cell-title { order: 0; }
  /* 序号：最前一列，浅灰细体 */
  .table-wrap.price-list-wrap td.price-seq {
    text-align: center; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums;
  }
  /* 产品名：加粗深色 */
  .table-wrap.price-list-wrap td.price-name {
    font-size: 12.5px; font-weight: 700; color: var(--text);
  }
  /* 含量/PH/规格：小字灰色 */
  .table-wrap.price-list-wrap td.price-meta { font-size: 11px; color: var(--text-2); }
  /* 吨价：右对齐，蓝色突出 */
  .table-wrap.price-list-wrap td.price-value {
    text-align: right; font-size: 12.5px; font-weight: 800; color: var(--primary);
    font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  }
  .table-wrap.price-list-wrap tr.row-empty { padding: 16px 12px; }
  .table-wrap.price-list-wrap tr.row-empty td { display: flex !important; justify-content: center; white-space: normal; }
  /* 顶部操作区在手机上更紧凑 */
  #price-card .card-head { flex-direction: column; align-items: stretch; gap: 8px; }
  #price-card .card-head .actions { display: flex; flex-wrap: wrap; }
  #price-card .card-head .actions .input#price-q { flex: 1 1 100%; width: 100% !important; }
  #price-card .card-head h3 small { display: block; margin-top: 2px; }
  /* 系列标签在手机上横向可滚动，避免换行占空间 */
  .price-series-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-bottom: 10px; }
  .price-series-tab { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; }
}

/* 付款截图上传/预览/查看 */
.file-input { font-size: 13px; padding: 8px 0; }
.file-input::file-selector-button {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; margin-right: 10px;
}
.shot-preview { margin-top: 8px; }
.shot-preview img { max-width: 180px; max-height: 130px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.shot-preview .btn { margin-top: 8px; }
.shot-view { text-align: center; }
.shot-view img { max-width: 100%; max-height: 70vh; border-radius: 8px; }
@media print { .no-print { display: none !important; } }

/* 待办驾驶舱 */
.cockpit { margin-top: 16px; }
.cockpit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.cockpit-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 10px; padding: 12px 14px; cursor: pointer; text-align: left;
  transition: border-color .15s, transform .15s; font-size: 13px;
}
.cockpit-item:hover { border-color: var(--primary); transform: translateY(-1px); }
.cockpit-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.cockpit-label { font-weight: 600; }
.cockpit-num { margin-left: auto; font-size: 18px; font-weight: 800; color: var(--primary); }
.cockpit-money { width: 100%; padding-left: 17px; font-size: 12px; color: var(--text-3); }
@media (max-width: 768px) {
  /* 三项待办时两列会剩半格，改单列清单更好点也更好读 */
  .cockpit-grid { grid-template-columns: 1fr; gap: 8px; }
  .cockpit-item { padding: 12px 14px; flex-wrap: nowrap; }
  .cockpit-money { width: auto; padding-left: 0; margin-left: 8px; }
  .cockpit-num { font-size: 17px; }
}

/* 经营利润 · 利润表 */
.notice {
  display: flex; align-items: flex-start; gap: 8px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 16px;
  font-size: 13px; color: var(--text-2); line-height: 1.7;
}
.notice.amber { border-color: #f6d9a8; background: var(--warning-soft); color: #92500a; }

.pnl { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.pnl-row {
  display: grid; grid-template-columns: 1fr 132px 110px;
  align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.pnl-row:last-child { border-bottom: 0; }
.pnl-label { min-width: 0; }
.pnl-label small { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.pnl-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.pnl-compare { text-align: right; white-space: nowrap; }
.pnl-delta { font-size: 11.5px; color: var(--text-3); }
.pnl-delta.up { color: var(--danger); }
.pnl-delta.down { color: var(--success); }
.pnl-row.sub { padding-left: 28px; background: var(--surface-2); font-size: 12.8px; color: var(--text-2); }
.pnl-row.sub .pnl-value { font-weight: 500; }
.pnl-row.total { background: var(--primary-soft); }
.pnl-row.total .pnl-label { font-weight: 700; }
.pnl-row.total .pnl-value { font-size: 15px; font-weight: 800; }
.pnl-row.grand { background: var(--success-soft); }
.pnl-row.grand .pnl-label { font-weight: 800; font-size: 14.5px; }
.pnl-row.grand .pnl-value { font-size: 17px; font-weight: 800; }

/* 员工工资 · 表单实时试算 */
.payroll-preview {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin-top: 14px; padding: 12px 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13px; color: var(--text-2);
}
.payroll-preview b { color: var(--text); font-size: 15px; }

@media (max-width: 768px) {
  .pnl-row { grid-template-columns: 1fr auto; padding: 10px 12px; }
  .pnl-compare { display: none; }
  .pnl-row.sub { padding-left: 22px; }
  .pnl-row.grand .pnl-value { font-size: 16px; }
  .payroll-preview { gap: 10px; justify-content: space-between; }
}

/* 经营利润 · 补充指标（现金 / 待发工资 / 应收应付） */
.mini-facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.mini-facts > div {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 10px 12px;
}
.mini-facts span { display: block; font-size: 12px; color: var(--text-3); }
.mini-facts b { display: block; font-size: 16px; font-weight: 800; margin: 2px 0 1px; }
.mini-facts small { display: block; font-size: 11.5px; color: var(--text-3); }
@media (max-width: 480px) {
  .mini-facts { grid-template-columns: 1fr; }
}
/* 右侧窄栏内的指标卡：两列太挤时退为单列 */
.mini-facts.wide { grid-template-columns: 1fr; margin-top: 0; padding-top: 0; border-top: 0; }
@media (min-width: 1500px) {
  .mini-facts.wide { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 版本信息 ================= */
/* 侧栏底部版本号：小字、低调，颜色用 --text-3，hover 提亮为主题色 */
.side-version {
  display: flex; align-items: center; gap: 6px;
  width: 100%; margin-top: 10px; padding: 8px 2px;
  border: 0; background: transparent;
  color: var(--text-3); font-size: 11.5px; text-align: left;
  border-radius: 6px; cursor: pointer; white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.side-version:hover { color: var(--primary); background: var(--surface-2); }
/* 绿色小圆点表示「运行正常」 */
.side-version-dot {
  width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(21, 163, 74, .14);
}

/* 登录页版本号 */
.login-version {
  text-align: center; font-size: 12px; color: var(--text-3);
  margin-top: 14px; letter-spacing: .01em;
}

/* 设置页卡片头部右侧按钮组 */
.card-head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 设置页的表单不做整行宽，保持在舒适阅读行长内，宽屏不显空旷 */
@media (min-width: 900px) {
  .view > .card .card-body > form { max-width: 560px; }
  .detail-grid.settings-detail-grid { max-width: 860px; }
}

/* 版本弹窗 · 头部 */
.about-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--border);
}
.about-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.about-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.about-version-badge {
  flex: 0 0 auto; padding: 5px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* 版本弹窗 · 键值信息 */
.about-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.about-meta > div {
  min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.about-meta small { display: block; font-size: 11px; color: var(--text-3); }
.about-meta b { display: block; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; }
.about-ok {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); margin-right: 6px; vertical-align: 1px;
}

/* 版本弹窗 · 更新记录 */
.about-log { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.about-log-item {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.about-log-item:last-child { border-bottom: 0; }
.about-log-item:first-child { background: var(--surface-2); }
.about-log-side { min-width: 0; }
.about-log-side b { display: block; font-size: 13px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.about-log-side small { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; }
.about-log-badge {
  display: inline-flex; align-items: center;
  margin-top: 5px; padding: 0 7px; border-radius: 999px; line-height: 17px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.about-log-points { margin: 0; padding-left: 16px; color: var(--text-2); font-size: 12.8px; line-height: 1.75; }
.about-log-points li { margin: 0; }

@media (max-width: 768px) {
  /* 手机端更新记录改为单列：版本号与日期同一行，徽标跟在后面 */
  .about-log-item { grid-template-columns: 1fr; gap: 6px; padding: 10px 12px; }
  .about-log-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .about-log-side b { font-size: 13px; }
  .about-log-side small { margin-top: 0; }
  .about-log-badge { margin-top: 0; }
  .about-log-points { padding-left: 15px; font-size: 12.5px; }
  .about-meta { grid-template-columns: 1fr; }
  .side-version { font-size: 11px; }
  .card-head-tools { width: 100%; }
}

/* ===== 产品物性数据卡片（员工资料 → 产品数据） ===== */
.pd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.pd-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.pd-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-2px); }
.pd-card-main {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 13px 14px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.pd-card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pd-name { font-weight: 700; font-size: 14.5px; color: var(--text); line-height: 1.4; }
.pd-verifier { flex: none; font-size: 11px; color: var(--text-3); background: var(--surface-3); padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.pd-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pd-tag { font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; }
.pd-card-metrics { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 10px; }
.pd-card-metrics > div { display: flex; flex-direction: column; min-width: 0; }
.pd-card-metrics small { font-size: 11px; color: var(--text-3); }
.pd-card-metrics b { font-size: 16px; color: var(--primary); font-weight: 700; line-height: 1.3; }
.pd-card-metrics > div:last-child b { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.pd-card-elems {
  margin-top: 8px; font-size: 12px; color: var(--text-2); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-top: 8px; border-top: 1px dashed var(--border);
}
.pd-card-foot {
  display: flex; gap: 8px; padding: 9px 14px 12px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.pd-mini-btn {
  flex: 1; font-size: 12px; padding: 6px 8px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--text-2); font-weight: 600;
  transition: all .15s var(--ease);
}
.pd-mini-btn:hover { border-color: var(--primary); color: var(--primary); }
.pd-mini-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.pd-mini-btn.primary:hover { background: var(--primary-hover); }
.pd-need { flex: none; font-size: 11px; padding: 2px 9px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.pd-need-yes { background: var(--success-soft); color: var(--success); }
.pd-need-no { background: var(--surface-3); color: var(--text-3); }
.pd-card-sub { display: flex; gap: 18px; margin-top: 9px; font-size: 12px; color: var(--text-3); }
.pd-card-sub b { color: var(--text-2); font-weight: 600; margin-left: 3px; }

/* 详情弹窗：分组参数表 */
.pd-detail { display: flex; flex-direction: column; gap: 16px; }
.pd-detail-group { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.pd-detail-title {
  font-size: 12.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); padding: 8px 12px;
}
.pd-detail-list { display: grid; grid-template-columns: repeat(2, 1fr); }
.pd-detail-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 12px; border-top: 1px solid var(--border); font-size: 12.5px;
}
.pd-detail-item:nth-child(odd) { border-right: 1px solid var(--border); }
.pd-detail-item span { flex: none; width: 92px; color: var(--text-3); }
.pd-detail-item b { color: var(--text); font-weight: 600; white-space: pre-line; word-break: break-word; }

@media (max-width: 768px) {
  .pd-grid { grid-template-columns: 1fr; gap: 10px; }
  .pd-detail-list { grid-template-columns: 1fr; }
  .pd-detail-item:nth-child(odd) { border-right: 0; }
  .pd-detail-item span { width: 84px; }
  .pd-card-metrics b { font-size: 15px; }
}

/* ===== 操作日志筛选（关键操作记录查询） ===== */
.audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.audit-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.audit-field label { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.audit-field .input { width: 100%; }
.audit-filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
@media (max-width: 768px) {
  .audit-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .audit-filter-row .input { flex: 1 1 100% !important; width: 100% !important; }
  .audit-filter-row .btn { flex: 1; }
}

/* ===== 产品数据 / 报价单条维护按钮 ===== */
.btn.danger, .pd-mini-btn.danger { color: var(--danger, #dc2626); border-color: var(--danger, #dc2626); }
.pd-mini-btn.danger:hover { background: var(--danger, #dc2626); color: #fff; border-color: var(--danger, #dc2626); }
.price-row-edit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-left: 4px; padding: 0;
  font-size: 12px; line-height: 1; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-2); color: var(--text-3);
  vertical-align: middle;
}
.price-row-edit:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* 管理员维护入口：产品卡 4 按钮用 2×2 网格，避免文案换行；产品名点击提示 */
.pd-card-foot-admin { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pd-card-foot-admin .pd-mini-btn { white-space: nowrap; font-size: 12px; padding: 6px 4px; }
.price-name-editable { cursor: pointer; border-bottom: 1px dashed var(--primary); }
.price-name-editable:hover { color: var(--primary); background: var(--primary-soft); }

/* ==========================================================================
   v1.1.62 · 全端统一适配层（桌面 / 安卓 / iOS）
   A 控件与标签统一  B 卡片头与列表  C 产品数据  D 操作日志  E 报价表  F 弹层
   ========================================================================== */

/* ---------- A. 圆角与药丸标签统一 ---------- */
.card, .pd-card { border-radius: var(--radius); }
.kb-tab, .price-series-tab {
  border-radius: var(--pill);
  min-height: 32px;
  padding: 6px 13px;
  font-size: 12.5px;
  -webkit-tap-highlight-color: transparent;
}
.pd-mini-btn { border-radius: var(--ctl-r-sm); min-height: 34px; }
.pd-mini-btn, .link-btn, .close-x, .price-series-tab, .kb-tab { -webkit-tap-highlight-color: transparent; }

/* 筛选区字段标签与表单标签归一到同一套字重/字色 */
.audit-field { gap: 6px; min-width: 0; }
.audit-field label { font-size: 13px; font-weight: 600; color: #344054; }
.audit-field .input, .audit-field select, .audit-field textarea { width: 100%; min-width: 0; }

/* ---------- B. 卡片头 / 列表通用收敛 ---------- */
.card-head { flex-wrap: wrap; }
.card-head .actions { min-width: 0; }
.pd-card-title { gap: 10px; }
.pd-name { min-width: 0; word-break: break-word; }
.pd-card-main { -webkit-tap-highlight-color: transparent; }
/* 产品数据表单：桌面两列，窄屏单列 */
.pd-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- C. 操作日志：筛选栏 + 手机端三行卡片 ---------- */
.audit-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.audit-list-wrap table { min-width: 720px; }
.audit-action .badge { vertical-align: 1px; }

/* ---------- D. 报价表 ---------- */
.price-name-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 产品名与「联动」标签同一行：名称可省略，标签不被吞 */
td.price-name { display: flex; align-items: center; gap: 5px; }

/* ---------- E. 触摸设备：去掉粘滞 hover ---------- */
@media (hover: none) {
  .pd-card:hover { transform: none; box-shadow: var(--shadow-xs); border-color: var(--border); }
  .kb-entry-card:not(.active):hover { transform: none; box-shadow: var(--shadow-xs); border-color: var(--border); }
  .kb-tab:hover, .price-series-tab:hover { border-color: var(--border); color: var(--text-2); }
  .pd-mini-btn:hover { border-color: var(--border-strong); background: var(--surface); color: var(--text-2); }
  .price-name-editable:hover { background: transparent; color: inherit; }
}

/* ---------- F. 平板 / 窄桌面：卡片头工具区占满一行 ---------- */
@media (max-width: 1024px) {
  .card-head .actions { width: 100%; }
  .audit-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- G. 手机（安卓 + iOS） ---------- */
@media (max-width: 768px) {
  :root { --ctl-h: 44px; --ctl-h-sm: 40px; }

  /* 触控目标：按钮不低于 42px，紧凑按钮 38px */
  .btn { min-height: 42px; padding: 9px 14px; }
  .btn.sm { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  .link-btn { padding: 4px 0; }
  .close-x { width: 36px; height: 36px; border-radius: var(--ctl-r-sm); }

  /* 所有原生控件 16px 起，避免 iOS 聚焦时整页放大 */
  select, input:not([type="checkbox"]):not([type="radio"]), textarea { font-size: 16px; }
  /* 客户统计的迷你下拉空间极小，退回无箭头以保住文字 */
  .customer-stat-toolbar .select { background-image: none; padding-right: 6px; }

  /* 弹层：底部抽屉，贴合安全区 */
  body.modal-open { overflow: hidden; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.small {
    width: 100%; max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal-head { position: relative; padding: 18px 16px 12px; }
  .modal-head::before {
    content: ""; position: absolute; top: 7px; left: 50%;
    width: 38px; height: 4px; margin-left: -19px;
    border-radius: 2px; background: #dfe5ee;
  }
  .modal-head h3 { font-size: 16px; }
  .modal-body {
    padding: 14px 16px 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .modal-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    flex-wrap: wrap; gap: 8px;
  }
  .modal-foot .btn { flex: 1 1 0; min-width: 0; }
  .modal-foot .btn.primary { flex: 1 1 100%; }

  /* 全局搜索：手机端全屏，输入区吸顶，结果区独立滚动 */
  .gs-overlay { align-items: stretch; padding: 0; }
  .global-search-modal, .global-search-modal.small {
    width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none;
    border-radius: 0;
  }
  .global-search-modal .modal-head {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px;
  }
  .global-search-modal .modal-head::before { display: none; }
  .global-search-modal .modal-body {
    display: flex; flex-direction: column; gap: 0;
    padding: 0 14px; overflow: hidden;
  }
  .global-search-modal .modal-foot {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .gs-search {
    position: sticky; top: 0; z-index: 2;
    padding: 8px 0; background: var(--surface);
  }
  .gs-input { height: 44px; font-size: 16px; padding-right: 46px; }
  .gs-clear { right: 10px; width: 32px; height: 32px; }
  .gs-chips {
    margin: 0 -14px; padding: 4px 14px 9px;
    border-bottom: 1px solid var(--border); background: var(--surface);
    -webkit-overflow-scrolling: touch;
  }
  .gs-chip { min-height: 34px; padding: 7px 12px; font-size: 13px; }
  .gs-summary { padding: 10px 2px 2px; }
  .gs-results {
    max-height: none; flex: 1 1 auto; min-height: 0;
    margin: 0 -4px; padding: 0 4px 12px;
  }
  .gs-section-title { padding: 10px 6px 4px; font-size: 12.5px; }
  .gs-result { min-height: 56px; padding: 10px 8px; gap: 11px; }
  .gs-result-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .gs-result-title { font-size: 14px; }
  .gs-result-sub { font-size: 12.5px; }
  .gs-empty { padding: 48px 20px; }
  .gs-empty b { font-size: 15px; }
  .gs-empty span { font-size: 13px; }

  .pd-form-grid, .audit-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 产品数据卡片 */
  #product-data-card .card-head { flex-direction: column; align-items: stretch; gap: 8px; }
  #product-data-card .card-head h3 { white-space: normal; }
  #product-data-card .card-head small { display: block; margin-top: 2px; }
  #product-data-card .card-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  #product-data-card .card-head .actions #product-data-q { flex: 1 1 100%; width: 100% !important; }
  #product-data-card .card-head .actions .btn { flex: 1 1 auto; }
  #product-data-card .card-body { padding: 14px; }
  .pd-grid { grid-template-columns: 1fr; gap: 10px; }
  .pd-card-foot { padding: 10px 14px; gap: 8px; }
  .pd-card-foot-admin { gap: 8px; }
  .pd-mini-btn { min-height: 42px; font-size: 13px; }
  .pd-card-foot-admin .pd-mini-btn { padding: 8px 4px; font-size: 12.5px; }
  .pd-detail { gap: 14px; }
  .pd-detail-item { padding: 10px 12px; font-size: 13px; }
  .pd-detail-item span { width: 86px; flex: 0 0 86px; }
  .pd-detail-item b { font-size: 13px; }

  /* 操作日志筛选与记录 */
  .audit-filter-grid { gap: 10px; }
  .audit-filter-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; align-items: center; margin-top: 12px;
  }
  .audit-filter-row #audit-q { grid-column: 1 / -1; width: 100% !important; min-width: 0 !important; }
  .audit-filter-row .btn { width: 100%; }
  .table-wrap[data-mobile-cards].audit-list-wrap { margin-top: 2px; }
  .table-wrap[data-mobile-cards].audit-list-wrap tr.audit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "actor time" "action action" "summary summary";
    align-items: baseline; row-gap: 5px; column-gap: 10px;
    padding: 12px 13px;
  }
  .table-wrap[data-mobile-cards].audit-list-wrap tr.audit-row td {
    display: block; padding: 0; border: 0; min-height: 0;
  }
  .table-wrap[data-mobile-cards].audit-list-wrap tr.audit-row td::before { content: none; }
  .audit-time {
    grid-area: time; font-size: 11.5px; color: var(--text-3);
    white-space: nowrap; font-variant-numeric: tabular-nums;
  }
  .audit-actor { grid-area: actor; font-size: 13.5px; font-weight: 700; color: var(--text); }
  .audit-action { grid-area: action; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
  .audit-target { display: none; }
  .table-wrap[data-mobile-cards].audit-list-wrap tr.audit-row td.seq-cell,
  .table-wrap[data-mobile-cards].audit-list-wrap tr.audit-row td.audit-target { display: none; }
  .audit-summary {
    grid-area: summary; font-size: 12.5px; color: var(--text-2); line-height: 1.55;
    padding-top: 5px; border-top: 1px dashed #eef1f6;
    word-break: break-word;
  }
  .audit-summary:empty { display: none; }
  .audit-list-wrap tr.audit-row[data-audit-kind="sensitive"] { border-color: #f3d0d0; }

  /* 报价表：产品名与「联动」标签同行，长名省略号不吞标签 */
  .table-wrap.price-list-wrap tr.price-row { min-height: 38px; }
  .table-wrap.price-list-wrap td.price-name { display: flex !important; align-items: center; gap: 4px; }
  .price-name-text { flex: 1 1 auto; }
  .price-auto-tag { flex: 0 0 auto; margin-left: 0; }
  .table-wrap.price-list-wrap td.price-name-editable { min-height: 30px; }
  .table-wrap.price-list-wrap tr.row-empty td[colspan] {
    grid-column: 1 / -1; white-space: normal; overflow: visible;
  }
}

/* 极窄屏（≤400）：产品维护表单单列，避免输入框被压到 150px 以下 */
@media (max-width: 600px) {
  .audit-filter-grid.pd-form-grid { grid-template-columns: 1fr; }
  .audit-field label { font-size: 12.5px; }
}
@media (max-width: 340px) {
  .pd-card-foot-admin .pd-mini-btn { font-size: 12px; padding: 8px 2px; }
  .audit-filter-row { grid-template-columns: 1fr; }
  .audit-filter-row .btn { width: 100%; }
  .pd-card-foot-admin { grid-template-columns: 1fr; }
}

/* ≤600px：报价表头部四个操作按钮排 2×2，避免「3+1」孤儿按钮；平板仍保持一行 */
@media (max-width: 600px) {
  #price-card .card-head .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #price-card .card-head .actions #price-q { grid-column: 1 / -1; }
  #price-card .card-head .actions .btn { width: 100%; }
}

/* ≤420px：窄屏报价行优先保产品名与吨价可读，含量列在手机单行内无法辨读，改由点开/导出查看 */
@media (max-width: 420px) {
  .table-wrap.price-list-wrap tr.price-row {
    grid-template-columns: 18px minmax(0, 3.3fr) minmax(0, 1.05fr) minmax(0, 1.15fr) minmax(0, 1.5fr);
  }
  .table-wrap.price-list-wrap td.price-meta.price-content { display: none !important; }
  .table-wrap.price-list-wrap tr.row-empty td[colspan] { grid-column: 1 / -1; }
}

/* 桌面端报价表：让「产品名称」拿到与内容匹配的宽度，避免含量列吃掉整表留白 */
@media (min-width: 769px) {
  .price-table th:nth-child(1) { width: 56px; }
  .price-table th:nth-child(2) { width: 23%; }
  .price-table th:nth-child(3) { width: 30%; }
  .price-table th:nth-child(4) { width: 9%; }
  .price-table th:nth-child(5) { width: 14%; }
  .price-table th:nth-child(6) { width: 15%; }
  /* 可编辑提示只在指针设备悬停时出现，避免整列虚线下划线干扰阅读 */
  .price-name-editable { border-bottom-color: transparent; }
  .price-name-editable:hover { border-bottom-color: var(--primary); }
}

/* 产品详情：桌面端标签列加宽，长标签（PH值（1%水溶液）等）不折行 */
@media (min-width: 769px) {
  .pd-detail-item span { width: 112px; flex: 0 0 112px; }
}

/* 列表页筛选栏：手机端搜索框独占一行，剩余下拉与按钮按两列自动配对 */
@media (max-width: 768px) {
  .toolbar > input[type="search"] { grid-column: 1 / -1; width: 100%; }
}
/* 明细行内的按钮与输入框同高，避免大小不齐 */
.quote-line .btn.sm, .quote-group-head .btn.sm { min-height: var(--ctl-h); }

/* 平板竖屏（601–768）：产品卡两列，避免 768 宽只剩一列过大留白 */
@media (min-width: 601px) and (max-width: 768px) {
  .pd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 键盘聚焦：控件用描边 + 光晕即可，去掉浏览器默认外框，避免双层焦点框 */
select:focus-visible, .input:focus-visible, .textarea:focus-visible,
.field select:focus-visible, .field input:focus-visible, .field textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
