/* ===== CSS Variables ===== */
:root {
  /* 层级变量（2.1.1.19 收敛，值保持原样，避免改变既有层叠关系） */
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 50;
  --z-sticky-2: 55;
  --z-panel: 60;
  --z-header: 70;
  --z-dropdown: 80;
  --z-float: 90;
  --z-topbar: 100;
  --z-fixed: 150;
  --z-popover: 400;
  --z-modal-low: 999;
  --z-modal: 1000;
  --z-modal-login: 1001;
  --z-boot: 1100;
  --z-modal-special: 1200;
  --z-progress: 1201;
  --z-toast: 9999;
  --bg: #F7F8FC;
  --sidebar-bg: var(--white);
  --white: #FFFFFF;
  --text-primary: #202124;
  --text-secondary: #5F6368;
  --text-tertiary: #9AA0A6;
  --blue: #1A73E8;
  --blue-light: #E8F0FE;
  --green: #34A853;
  --red: #EA4335;
  --red-light: #FCE8E6;
  --yellow: #FBBC04;
  --orange: #F59E0B;
  --border: #E5E7EB;

  /* 三级 elevation（2.0.4.29）：统一层级，替换全站散落的硬编码阴影 */
  --shadow-1: 0 1px 3px rgba(60, 64, 67, 0.08), 0 1px 2px rgba(60, 64, 67, 0.06);
  --shadow-2: 0 4px 12px rgba(60, 64, 67, 0.10), 0 2px 4px rgba(60, 64, 67, 0.06);
  --shadow-3: 0 12px 32px rgba(60, 64, 67, 0.16), 0 4px 8px rgba(60, 64, 67, 0.08);
  /* 向后兼容：保留旧变量名并指向一级阴影，避免遗漏的引用处失效 */
  --card-shadow: var(--shadow-1);
  --fab-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);

  /* 缓动曲线（2.0.4.29）：Material 标准，替代默认 ease 的生硬感 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* 2.1.3-beta11：原固定 256px。改 clamp 后大屏（≥1600）放大到 288px 更舒展，
     1024 平板/小笔记本自动收到 220px 给内容让位（1440 常见屏≈259px，与原值基本一致）。
     ⚠ 该变量被 .sidebar 宽度（528）与详情视图的 left/width 计算（3941/3946）共用，
     改这里三处一起生效，不要再去子处硬编码。 */
  --sidebar-width: clamp(220px, 18vw, 288px);
  --toolbar-height: 64px;
  --radius: 8px;
  --radius-pill: 24px;

  /* 字体栈（2.0.4.29）：原为 'Inter Tight' / 'DM Sans'，二者均不含中文字形，
     且 index.html 从未引入字体文件，浏览器 100% 回退系统字体（Windows 即雅黑）。
     改为中文优先的系统字体栈：零外部依赖，内网/离线部署最稳。 */
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;

  /* ===== 颜色语义补全（2.0.4.29）===== */
  /* 别名：让组件层双轨写法 var(--text, #1f2733) 的 fallback 自动对齐主 token，
     组件无需改动即消除「两套命名打架」问题。 */
  --text: var(--text-primary);
  --text-muted: var(--text-secondary);
  --bg-secondary: #F1F3F4;
  --surface: #FFFFFF;
  --surface-2: #F1F3F4;
  --divider: #E5E7EB;
  --text-disabled: #B7BCC2;

  /* 品牌色衍生（浅底/深色文字），供标签/徽章/状态条复用 */
  --blue-dark: #1557B0;
  --green-light: #E6F4EA;
  --green-dark: #1E8E3E;
  --red-dark: #C5221F;
  --error: #E5484D;
  --error-light: #F5C6CB;
  --error-dark: #C5221F;

  /* 警告/维护条（黄系）专用语义色，替代散落的 var(--warn-bg)/var(--warn-border)/var(--warn-text) */
  --warn-bg: #FEF7E6;
  --warn-border: #F5E1A8;
  --warn-text: #8A5A00;

  /* 紫色语义（权限/标签标记） */
  --purple: #7C3AED;
  --purple-light: #EDE9FE;

  /* ===== 别名补全（2.1.3-beta44）=====
     历史遗留：组件层引用了 --border-color / --muted / --accent 等「从未定义过」的变量，
     于是永远渲染成各处的回退旧值（旧蓝、旧灰），主题切换对它们完全无效。
     这里把它们接到现有语义 token 上，使其跟随主题（含暗色，因右侧都是 var 引用）。
     ⚠ 回退行为（已实测，注释掉 theme-pro.css 时）：右侧 token 分两类——
       ① style.css 自带的（--blue / --border / --text-secondary / --surface / --surface-2 /
          --divider / --blue-light）：仍生效，全站统一回到 style.css 的旧口径
          （旧 Google 蓝 / 旧浅灰边框 / 旧次要灰），口径一致、不会失色；
         （此处刻意不写十六进制色值：注释里的色值会污染 grep 统计，导致「还有几处旧色」误判）
       ② 仅 theme-pro 定义的（--state-danger / --state-ok / --radius-sm）：缺失时 --x 变 invalid，
          各处的 var(--x, 旧值) 自动回退字面量，与原行为完全一致。
     ⚠ 不在此处定义 --cat-bg / --cat-text / --user-bg：这三个是**运行时注入**的
       （week.js / settings.js 用 el.style.setProperty 按分类、按用户写入颜色），
       必须保持「:root 未定义」才能落到各处的回退值；在此定义反而会掩盖注入缺失。 */
  --border-color: var(--border);
  --muted: var(--text-secondary);
  --bg-primary: var(--surface);
  --bg-input: var(--surface);
  --accent: var(--blue);
  --primary: var(--blue);
  --link: var(--blue);
  --accent-soft: var(--blue-light);
  --danger: var(--state-danger);
  --success: var(--state-ok);
  --hover: var(--surface-2);
  --bg-hover: var(--surface-2);
  --hover-strong: var(--divider);
  --radius-md: var(--radius-sm, 10px);
  /* 非颜色：保持原义，仅让变量「已定义」，消除回退歧义 */
  --font-mono: monospace;
}

/* ===== 暗色模式（2.0.4.30）：仅覆盖语义变量，组件层零改动 ===== */
[data-theme="dark"] {
  --bg: #202124;
  --sidebar-bg: #2A2B2D;
  --white: #2D2E30;
  --text-primary: #E8EAED;
  --text-secondary: #BDC1C6;
  --text-tertiary: #9AA0A6;
  --blue: #8AB4F8;
  --blue-light: #2A3A55;
  --blue-dark: #AECBFA;
  --green: #81C995;
  --green-light: #1E3A2F;
  --green-dark: #A8DAB5;
  --red: #F28B82;
  --red-light: #4A2C2A;
  --red-dark: #F6AEA9;
  --yellow: #FDDE85;
  --orange: #FDD663;
  --border: #3C4043;
  --divider: #3C4043;
  --bg-secondary: #35363A;
  --surface: #292A2D;
  --surface-2: #35363A;
  --text-disabled: #5F6368;
  --purple: #B794F6;
  --purple-light: #3A2E4D;
  --error: #F28B82;
  --error-light: #4A2C2A;
  --error-dark: #F6AEA9;
  --warn-bg: #4A3A1A;
  --warn-border: #5A4A2A;
  --warn-text: #FDD663;
  --shadow-1: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.6), 0 4px 8px rgba(0,0,0,0.4);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.4);
  --fab-shadow: 0 4px 12px rgba(138,180,248,0.3);
}
[data-theme="dark"] body { background: var(--bg); }

/* ===== 暗色模式：内联硬编码色补救（JS 用 CSS 变量 --cat-bg/--cat-text/--user-bg 驱动，color-mix 自动适配，切换主题无需 JS 重渲染） ===== */
/* 分类标签：暗色下用 color-mix 把浅色分类底与暗背景混合，文字统一为亮色 */
[data-theme="dark"] .entry-category {
  background: color-mix(in srgb, var(--cat-bg) 30%, var(--bg)) !important;
  color: var(--text-primary) !important;
}
/* 管理员全部员工模式下用户底色条目（本周工作 + 历史记录共用） */
[data-theme="dark"] .day-entry[data-user-id],
[data-theme="dark"] .history-entry[data-user-id] {
  background: color-mix(in srgb, var(--user-bg) 32%, var(--bg)) !important;
}
/* 已完成条目的绿色背景 */
[data-theme="dark"] .day-entry.is-completed {
  background: #1A2E1F !important;
}

/* ===== 暗色模式：图表对比度增强 ===== */
[data-theme="dark"] .stats-trend-bars {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
[data-theme="dark"] .stats-trend-bar {
  background: var(--blue) !important;
}
[data-theme="dark"] .stats-trend-bar-done {
  background: var(--green) !important;
}
[data-theme="dark"] .stats-trend-count {
  color: #E8EAED !important;
  font-weight: 700;
  opacity: 0.95;
}
[data-theme="dark"] .stats-trend-label {
  color: #BDC1C6 !important;
}

/* 分类统计暗色适配 */
[data-theme="dark"] .stats-cat-row {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
[data-theme="dark"] .stats-cat-bar-wrap {
  background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .stats-cat-bar {
  background: color-mix(in srgb, var(--cat-bg) 55%, #2A2B32) !important;
}
[data-theme="dark"] .stats-cat-meta {
  color: var(--text-primary) !important;
  font-weight: 500;
}
/* 分类统计小图标的暗色适配 */
[data-theme="dark"] .cat-color-dot {
  background: color-mix(in srgb, var(--cat-bg) 35%, var(--bg)) !important;
}

/* ===== 外观设置（主题切换）样式 ===== */
.appearance-theme-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.appearance-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.theme-options { display: flex; gap: 8px; }
.theme-opt {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s var(--ease);
}
.theme-opt:hover { border-color: var(--blue); color: var(--blue); }
.theme-opt.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ===== 全局微交互层（2.0.4.29）===== */
/* 键盘可达性：统一聚焦轮廓（替代各浏览器默认生硬 outline） */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}
/* 文本选中色：品牌蓝浅底 */
::selection {
  background: var(--blue-light);
  color: var(--blue);
}
/* 禁用态统一样式（按钮由自身 .btn:disabled 控制，这里覆盖普通元素） */
:disabled, [disabled], .is-disabled, .disabled {
  cursor: not-allowed;
}
:disabled:not(.btn):not(button),
.is-disabled:not(.btn):not(button),
.disabled:not(.btn):not(button) {
  opacity: .55;
}
/* 细滚动条：统一全站滚动体验（已显式隐藏滚动条的区域如 .settings-tabs 特异性更高，不受影响） */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

a { text-decoration: none; color: inherit; }

/* ===== Login Page ===== */
.login-page {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-login);
}

/* 启动加载态：默认显示，bootstrap 完成后立即隐藏，避免登录页闪屏 */
.boot-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}
.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.boot-logo-icon { line-height: 0; }
.boot-logo {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.boot-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.boot-loader .spinner {
  width: 28px;
  height: 28px;
  margin-top: 6px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: bootSpin 0.8s linear infinite;
}
@keyframes bootSpin {
  to { transform: rotate(360deg); }
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-3);
  width: 400px;
  max-width: 90vw;
  padding: 40px;
}
@media (max-width: 480px) {
  .login-card { padding: 28px; width: 100%; }
}

/* 登录选项：登录有效期（档位下拉） */
.login-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: -8px 0 0;
}
.login-ttl-select {
  flex: 0 0 auto;
  max-width: 160px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-input, #fff);
  border: 1px solid var(--border-color, #d0d5dd);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}
.login-ttl-select:focus { border-color: var(--accent, #2a6df4); }
/* 登录日志：记住登录徽章 */
.ll-remember {
  flex: 0 0 auto;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 16px;
  color: #1a7f37;
  background: rgba(26, 127, 55, 0.12);
  border: 1px solid rgba(26, 127, 55, 0.3);
  border-radius: 10px;
  white-space: nowrap;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.login-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 26px;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-field input {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease);
}

.login-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
  outline: none;
}

.login-error {
  color: var(--red);
  font-size: 13px;
  min-height: 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.login-error:not(:empty) {
  background: var(--red-light);
  color: var(--red);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 0;
  margin: -4px 0;
}
.login-error:not(:empty)::before {
  content: '';
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23EA4335' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v5'/%3E%3Cpath d='M12 16.5h.01'/%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3C/svg%3E");
}

.login-btn {
  height: 44px;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
}

.login-btn:hover {
  opacity: 0.92;
}
.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-btn:active {
  transform: translateY(1px);
}

/* 密码显隐切换 */
.login-pwd-wrap {
  position: relative;
}
.login-pwd-wrap input {
  padding-right: 44px;
}
.login-pwd-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.login-pwd-toggle:hover {
  color: var(--blue);
  background: var(--blue-light);
}

/* ===== App Layout ===== */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 4px;
  overflow: visible;
  position: relative;
  z-index: var(--z-raised);
  /* 2.0.4.29：侧边栏改为纯白底后，与同为主内容区的白卡片之间需要明确边界。
     用 box-shadow 而非 border-right，避免占用 1px 布局宽度影响 --sidebar-width 计算。 */
  box-shadow: 1px 0 0 var(--border);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
}
/* 点击「工作OA」返回首页：点击目标是文字本身而非整块 .logo-section。
   窄屏（≤1200px）侧栏收起时 .logo-text 被隐藏，因而自动不可点击，
   不会在顶部留下一块看不见的误触热区。 */
.logo-text { cursor: pointer; user-select: none; }
.logo-text:hover { color: var(--blue, #1a73e8); }
.logo-text:focus-visible { outline: 2px solid var(--blue, #1a73e8); outline-offset: 2px; border-radius: 6px; }
/* 顶栏「未完成」入口的计数徽标 */
.pending-pill-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--error, #d93025); color: var(--white, #fff);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.8px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  /* 2.1.3-beta39：4 → 2。左导航每组 4~5 项，节距 44px 偏松，矮视口下更要滚动很久 */
  gap: 2px;
  /* 视口矮时左导航溢出：允许列表自身收缩并出现纵向滚动条，
     保证底部「设置 / 更多 / 导航设置 / 用户区」始终可见（被 #app overflow:hidden 裁掉的问题）。 */
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 2.1.3-beta39：40 → 34。与 .nav-list gap 收紧配套；窄屏块会覆盖为 height:auto，不受影响 */
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  user-select: none;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.nav-item.active {
  background: var(--blue);
  color: var(--white);
}

.nav-item.active svg {
  color: var(--white);
}

.nav-item span {
  font-size: 14px;
  font-weight: 500;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--error);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  padding: 0 5px;
  box-sizing: border-box;
}
.nav-item.active .nav-badge {
  background: var(--white);
  color: var(--blue);
}

/* ===== 2.1.2-beta2：PC 左侧导航「更多 ▾」折叠 ===== */
.nav-item .nav-more-caret {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.15s var(--ease);
}
.nav-item.open .nav-more-caret {
  transform: rotate(180deg);
}
.nav-more-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 26px;
  box-sizing: border-box;
}
.nav-more-child {
  height: 36px;
}
.nav-more-child span {
  font-size: 13px;
  font-weight: 500;
}

/* ===== 2.1.2-beta3：左导航底部「导航设置」入口 + 弹窗 ===== */
.nav-config-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  margin-top: 4px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  width: 100%;
  text-align: left;
}
.nav-config-entry:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}
.nav-config-entry svg { flex: none; }

.nav-config-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 10px;
  max-height: 56vh;
  overflow-y: auto;
}
.nav-config-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--hairline);
}
.nav-config-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}
.nav-config-fixed {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 56px;
  text-align: right;
}
.nav-config-move {
  padding: 2px 10px;
  font-size: 13px;
  line-height: 1.4;
}
/* 2.1.3-beta37：列表内滚动条紧贴 ↑↓ 按钮 → 右侧留出滚动条槽位，按钮不再被压边 */
.nav-config-list { padding-right: 10px; }
/* 2.1.3-beta37：底部按钮条。.modal-actions 全局只有 display:flex、没有 padding，
   按钮直接贴到弹窗右下边缘、与上方列表之间也没有任何分隔线（看起来"散在角上"）。
   本弹窗单独补：底栏底色 + 上分隔线 + 四周留白（不动全局 .modal-actions，避免波及别的弹窗）。 */
#navConfigModal .modal-actions {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* Toggle Switch（开=主区显示，关=收进「更多」） */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: none;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd1d9;
  border-radius: 999px;
  transition: background 0.15s var(--ease);
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s var(--ease);
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

.spacer {
  flex: 1;
}

/* ===== Profile Section (clickable → dropdown) ===== */
.profile-section {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  border-radius: 12px;
  padding: 0 8px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.profile-section:hover {
  background: rgba(0, 0, 0, 0.04);
}

.profile-section.open {
  background: rgba(0, 0, 0, 0.06);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

/* ===== 2.1.2-beta4：统一头像图片（有图用图，无图回退首字）===== */
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; background: #eef1f5; }
.avatar.has-img, .user-row-avatar.has-img, .stats-user-avatar.has-img,
.entry-user-avatar.has-img, .personal-info-avatar.has-img {
  background: none !important; padding: 0 !important; color: transparent !important;
}
.personal-info-avatar.clickable { cursor: pointer; transition: box-shadow .15s; }
.personal-info-avatar.clickable:hover { box-shadow: 0 0 0 2px var(--blue); }

/* ===== 2.1.2-beta4 头像裁剪弹窗 ===== */
.avatar-cropper-overlay.modal-overlay { z-index: 1300; }
.avatar-cropper-modal { width: 360px; max-width: 92vw; padding: 18px 20px; }
.avatar-cropper-modal .modal-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; color: var(--text-primary, #202124); }
.avatar-cropper-stage { position: relative; width: 320px; height: 320px; max-width: 100%; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #f1f3f4; }
.avatar-cropper-stage canvas { display: block; cursor: grab; touch-action: none; }
.avatar-cropper-stage canvas:active { cursor: grabbing; }
/* 取景圈：圆外整体压暗（box-shadow 挖洞法），任意深浅底图都能看清取景范围；
   白环用实线提高对比（原虚线贴白/深交界看不清）。 */
.avatar-cropper-mask { position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; transform: translate(-50%, -50%); border: 2px solid rgba(255,255,255,.96); border-radius: 50%; box-sizing: border-box; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); }
.avatar-cropper-tools { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.avatar-cropper-tools label { font-size: 13px; color: var(--text-secondary, #5f6368); white-space: nowrap; }
.avatar-cropper-tools input[type=range] { flex: 1; accent-color: var(--blue); }
.avatar-cropper-preview { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-size: 13px; color: var(--text-secondary, #5f6368); }
.avatar-cropper-preview canvas { border-radius: 50%; border: 1px solid var(--border, #e3e6ea); background: #f1f3f4; }
.avatar-cropper-actions { display: flex; justify-content: flex-end; gap: 10px; }
.avatar-cropper-tip { font-size: 12px; color: #9aa0a6; margin-top: 10px; line-height: 1.5; }

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 8px;
  display: inline-block;
  width: fit-content;
}

.role-badge.admin {
  background: var(--blue-light);
  color: var(--blue);
}

.role-badge.employee {
  background: var(--surface-2);
  color: var(--text-secondary);
}

.profile-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}

.profile-section.open .profile-chevron {
  transform: rotate(180deg);
}

/* ===== Profile Dropdown ===== */
.profile-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border);
  padding: 8px;
  z-index: var(--z-toast);
  animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.profile-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-dropdown-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.profile-dropdown-account {
  font-size: 11px;
  color: var(--text-tertiary);
}

.profile-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  font-size: 13px;
  font-weight: 500;
}

.dropdown-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.dropdown-item.logout:hover {
  background: var(--red-light);
  color: var(--red);
}

/* ===== Main Area ===== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  min-width: 0;
}

/* ===== Toolbar ===== */
.toolbar {
  height: var(--toolbar-height);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  gap: 16px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.date-range {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  white-space: nowrap;
}

.week-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 28px;
  border-radius: 14px;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.user-filter {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}

.user-filter:hover {
  border-color: var(--blue);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== 顶栏操作项：不换行、不压缩，避免被挤成「中文竖排」 =====
   新增「未完成」入口后顶栏超宽，按钮被 flex 压缩导致逐字换行。
   规则：操作项锁定宽度与单行；空间不足时优先压缩搜索框。按钮同时收紧尺寸。 */
.toolbar-left > *,
.toolbar-right > * { flex-shrink: 0; }
.toolbar .search-box { flex-shrink: 1; } /* 搜索框例外：允许收缩以让位 */
.toolbar .btn-secondary,
.toolbar .add-btn,
.toolbar .user-filter,
.toolbar .week-pill { white-space: nowrap; }
/* 顶栏小按钮（未完成 / 草稿）收紧 */
.toolbar .btn-secondary { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; }

/* ===== 2.1.3-beta39：顶栏瘦身 =====
   背景：1108px 宽下「未完成 + 搜索 + 铃铛 + 草稿 + 新增工作」已互相挤压，筛选下拉被挤到贴边。
   ⚠ 全部规则必须带 .toolbar 前缀：.user-filter 是**全局通用表单控件类**，被 mold / product /
     ship-spec / field-dict 等模块当作 input / select / textarea 复用，全局改会把各模块表单一起
     缩小（历史上 .user-filter{display:none} 就误伤过一次）。 */
.toolbar { padding: 0 16px; gap: 12px; }
.toolbar-left { gap: 10px; }
.toolbar .user-filter { height: 32px; padding: 0 10px; font-size: 12px; }
.toolbar .btn-secondary { padding: 0 10px; }
.toolbar .date-nav { gap: 8px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  /* 2.1.3-beta39：240 → 200，让顶栏右侧不再挤（见上方顶栏瘦身注释） */
  width: 200px;
  min-width: 120px;
  height: 40px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0 16px;
  color: var(--text-tertiary);
  transition: border-color 0.15s var(--ease);
}

.search-box:focus-within {
  border-color: var(--blue);
}

.search-box input {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-tertiary);
}

.add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s var(--ease), transform 0.1s var(--ease);
  white-space: nowrap;
}

.add-btn:hover {
  opacity: 0.92;
}

.add-btn:active {
  transform: scale(0.97);
}

/* ===== Content Area ===== */
.content-area {
  flex: 1;
  /* 2.1.3-beta39：顶部再 12 → 8（用户复核后要求继续收紧） */
  padding: 8px 24px 24px;
  overflow-y: auto;
  /* 2.1.1.40：常驻滚动条槽位。切换模块/设置子页时内容高度变化会导致滚动条
     出现/消失，引发整块内容横向回流抖动；stable 让槽位始终保留（不支持的浏览器忽略）。 */
  scrollbar-gutter: stable;
  /* 2.1.1.41：关闭浏览器「滚动锚定」。子页内容多为异步渲染（表格请求回来后才填充），
     高度突变时 Chrome 会自动补偿 scrollTop 以"稳住"某个元素，表现为整个模块上下偏移。
     关掉锚定后由我们自己控制滚动位置（见 switchSettingsTab 的复位逻辑）。 */
  overflow-anchor: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== Stats Row ===== */
.stats-row {
  display: flex;
  gap: 16px;
}

.stat-card {
  flex: 1;
  min-width: 0;
  height: 100px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--card-shadow);
  /* 2.0.4.29 视觉强化：定位上下文 + 裁切装饰元素（圆角处形成"切角"效果） */
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s var(--ease), transform .15s var(--ease);
}

.stat-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  /* 保证标签绘制在装饰圆之上（装饰伪元素是 absolute，默认会盖住 static 文字） */
  position: relative;
  z-index: var(--z-base);
}

.stat-value {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 28px;
  color: var(--text-primary);
  line-height: 1.2;
  /* 等宽数字：数值刷新时不产生宽度跳动 */
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  /* ⚠️ 禁止给 .stat-value 设置 position: relative（或 absolute/fixed/sticky）。
     下面两个装饰伪元素依赖「.stat-value 保持 static」这一前提：
     绝对定位元素的包含块是最近的 positioned 祖先，.stat-value 为 static 时
     包含块才会回溯到 .stat-card，从而用子元素的 class 反向装饰整张卡片。
     一旦 .stat-value 变成 positioned，伪元素将相对数字自身定位，效果静默失效。 */
}

/* 数值文字色：统一走变量（原 orange/red 在 Week View 区块用硬编码色，已并入此处） */
.stat-value-blue {
  color: var(--blue);
}

.stat-value-green {
  color: var(--green);
}

.stat-value-orange {
  color: var(--orange);
}

.stat-value-red {
  color: var(--red);
}

/* 左侧色条：默认灰，由 .stat-value-* 具体色类覆盖 */
.stat-card .stat-value::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--text-tertiary);
}

/* 右上角装饰圆：低透明度，不干扰数字阅读，超出部分由 overflow:hidden 裁成切角 */
.stat-card .stat-value::after {
  content: '';
  position: absolute;
  top: -18px;
  right: -18px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: .07;
}

/* 按已有数值色类自动取色：色条与装饰圆同步 */
.stat-card .stat-value-blue::before,
.stat-card .stat-value-blue::after {
  background: var(--blue);
}

.stat-card .stat-value-green::before,
.stat-card .stat-value-green::after {
  background: var(--green);
}

.stat-card .stat-value-orange::before,
.stat-card .stat-value-orange::after {
  background: var(--orange);
}

.stat-card .stat-value-red::before,
.stat-card .stat-value-red::after {
  background: var(--red);
}

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  /* 2.1.1.24：右侧按钮过多换行时，标题不允许被挤压成竖排 */
  white-space: nowrap;
  flex-shrink: 0;
}

/* 客户模块顶部操作栏（查重合并 / 新增客户），位于列表最上方 */
.customer-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  /* 2.1.1.24：按钮多时允许换行，但行距一致且保持右对齐，避免参差不齐 */
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  row-gap: 8px;
}
/* 客户筛选工具条（与顶部操作栏分离，避免拥挤） */
.customer-filter-bar {
  margin-top: 14px;
  flex-wrap: wrap;
  /* 2.1.1.24：筛选项多换行时行距一致 */
  row-gap: 8px;
}

/* ===== 2.0.4.44：客户列表增强 —— 批量操作 / 分页（2.0.4.45 已移除归属/视图模式 tabs 与看板/卡片视图）===== */
.cust-batchbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 12px;
  background: var(--blue-light, #e8f0fe); border: 1px solid var(--blue, #1a73e8);
  border-radius: 10px;
}
.cust-batch-count { font-size: 13px; font-weight: 600; color: var(--blue, #1a73e8); margin-right: 4px; }
.btn-link {
  border: 0; background: transparent; color: var(--text-secondary, #5f6368);
  font-size: 13px; cursor: pointer; text-decoration: underline;
}
.cust-col-check { width: 38px; text-align: center; }
.cust-col-check input { width: 15px; height: 15px; accent-color: var(--blue, #1a73e8); cursor: pointer; }

/* 看板视图（按状态分列） */
.cust-board { display: flex; gap: 12px; margin-top: 16px; overflow-x: auto; padding-bottom: 6px; }
.cust-board-col {
  flex: 0 0 220px; background: var(--bg, #f8f9fa); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px; min-height: 120px;
}
.cust-board-col-head {
  font-size: 13px; font-weight: 600; color: var(--text, #202124);
  padding: 6px 8px; border-top: 3px solid var(--blue, #1a73e8); border-radius: 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.cust-board-count { font-size: 12px; color: var(--text-secondary, #5f6368); font-weight: 400; }
.cust-board-card {
  background: var(--white, #fff); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; margin-top: 8px; cursor: pointer;
}
.cust-board-card:hover { border-color: var(--blue, #1a73e8); }
.cust-board-name { font-size: 13px; font-weight: 600; color: var(--text, #202124); word-break: break-all; }
.cust-board-meta { font-size: 12px; color: var(--text-secondary, #5f6368); margin-top: 3px; }
.cust-board-empty, .cust-empty {
  font-size: 12px; color: var(--text-secondary, #9aa0a6); padding: 8px; text-align: center;
}

/* 卡片视图（移动端友好） */
.cust-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px; margin-top: 16px;
}
.cust-card {
  background: var(--white, #fff); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; cursor: pointer;
}
.cust-card:hover { border-color: var(--blue, #1a73e8); }
.cust-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cust-card-name { font-size: 14px; font-weight: 600; color: var(--text, #202124); word-break: break-all; }
.cust-card-owner { font-size: 12px; color: var(--text-secondary, #5f6368); white-space: nowrap; }
.cust-card-meta { font-size: 12px; color: var(--text-secondary, #5f6368); margin-top: 6px; }

/* 分页条 */
.cust-pager {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; justify-content: flex-end;
}
.cust-pager-info { font-size: 12px; color: var(--text-secondary, #5f6368); }
.cust-pager-btn {
  border: 1px solid var(--border); background: var(--white, #fff);
  color: var(--text, #202124); font-size: 13px; padding: 4px 12px; border-radius: 8px; cursor: pointer;
}
.cust-pager-btn:disabled { opacity: .45; cursor: not-allowed; }

.section-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Week Grid ===== */
.week-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.week-row {
  display: flex;
  gap: 16px;
}

.day-card {
  flex: 1;
  min-width: 0;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--card-shadow);
}

.day-card.is-today {
  border: 2px solid var(--blue);
}

.day-card.is-rest {
  background: var(--bg);
  box-shadow: none;
  border: 1px dashed var(--border);
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-date {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.day-count {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
}

.day-count.is-zero {
  color: var(--text-tertiary);
}

.day-entries {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s var(--ease);
  background: var(--user-bg, transparent);
}

.entry-time {
  font-size: 12px;
  color: var(--text-tertiary);
  width: 48px;
  flex-shrink: 0;
}

.entry-title {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* User avatar badge in entry (admin view) */
.entry-user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.entry-category {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--cat-bg);
  color: var(--cat-text);
}

.entry-assignee {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 6px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===== Entry Action Buttons (hover) ===== */
.entry-actions {
  display: none;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.day-entry:hover .entry-actions {
  display: flex;
}

.entry-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg);
}

.entry-btn:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.entry-btn.close:hover {
  background: var(--red-light);
  color: var(--red);
}

.entry-btn.done:hover {
  background: var(--green-light);
  color: var(--green);
}

.entry-btn.reopen:hover {
  background: var(--blue-light);
  color: var(--blue);
}

/* ===== Completed Entry State ===== */
.day-entry.is-completed {
  background: var(--green-light);
  border-radius: 6px;
  padding: 4px 8px;
  margin: -4px -8px;
}

.day-entry.is-completed .entry-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.day-entry.is-completed .entry-time {
  text-decoration: line-through;
  color: var(--text-disabled);
}

.day-entry.is-completed .entry-category {
  opacity: 0.5;
}

.day-rest-text {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 8px 0;
}

.empty-cell {
  flex: 1;
  min-width: 0;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--fab-shadow);
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
  z-index: var(--z-topbar);
}

.fab:hover {
  opacity: 0.92;
}

.fab:active {
  transform: scale(0.93);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-boot); /* 高于 boot-loader(1000)/login-page(1001)，确保弹窗始终在最上层 */
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

/* ===== 新增工作：未完成选择 Picker (2.0.4.23) ===== */
.draft-picker {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 420px;
  max-width: 92vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-3);
}
.draft-picker-header {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.draft-picker-list {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.draft-picker-item {
  text-align: left;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 30px 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  transition: background 0.15s var(--ease);
}
.draft-picker-del {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.draft-picker-del:hover {
  background: rgba(229, 72, 77, 0.12);
  color: var(--error);
}
.draft-picker-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.draft-picker-item:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.draft-picker-item .dp-title {
  font-size: 13.5px;
  color: var(--text);
}
.draft-picker-item .dp-meta {
  font-size: 12px;
  color: var(--muted);
}
.draft-picker-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.draft-picker-spacer {
  flex: 1;
}
.draft-picker-clear {
  color: var(--error);
  border-color: rgba(229, 72, 77, 0.4);
}
.draft-picker-clear:hover {
  background: rgba(229, 72, 77, 0.08);
}

.modal {
  background: var(--white);
  border-radius: 12px;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-3);
  transform: scale(0.95);
  transition: transform 0.2s var(--ease);
}

.modal-overlay.show .modal {
  transform: scale(1);
}
/* ===== 弹窗尺寸分档（2.1.3-beta11，docs/UI优化待办.md #8）=====
   原全站统一 width:480px：复杂表单（新增客户/产品等）挤成单列、纵向过长；
   简单确认/选择类弹窗又显得过大。现分三档：
     .modal-sm 400px —— 确认框、单选/标签选择等轻内容（本文件新增）
     （默认）  480px —— 不加类即此档，与历史一致，现有弹窗零变化
     .modal-lg 640px —— 字段多的表单类弹窗（既有定义，见本文件后段「客户详情/跟进弹窗」区块）
   ⚠ .modal-lg 早在后段「客户详情/跟进弹窗」区块就有定义（width:640px，客户查重合并/跟进等
     弹窗在用）。此处若重复定义，同特异性下会被后段覆盖成死代码 → 故这里只新增 .modal-sm，
     lg 沿用既有值不再重复声明。
   ⚠ 不加类 = 保持 480px，因此给某个弹窗加类是可控的单点改动，不会波及全站。 */
.modal-sm { width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 200px;
}

.form-field-full {
  width: 100%;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-field input,
.form-field select {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease);
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--blue);
}

/* ===== Textarea ===== */
.form-field textarea {
  width: 100%;
  min-height: 132px;
  max-height: 300px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.15s var(--ease);
}

.form-field textarea:focus {
  border-color: var(--blue);
}

.form-field textarea::placeholder {
  color: var(--text-tertiary);
}

/* ===== Category Color Dot (used in settings category management) ===== */
.cat-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--cat-bg);
}

/* ===== Modal Footer ===== */
.modal-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.modal-footer-right {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

/* ===== 工作记录弹窗（.modal-entry，遮罩与内联宿主共用）：头与底部按钮固定，仅字段区滚动 =====
   原 footer 位于 .modal-body(form) 内，随内容被 .modal 的整体 overflow 裁切，
   内容一高就看不到底部按钮（"显示不了整个面"）。改为三段式：header 固定 / body 滚动 / footer 固定。 */
.modal-entry { display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.modal-entry .modal-header { flex-shrink: 0; }
.modal-entry .modal-body { flex: 1 1 auto; overflow-y: auto; align-content: flex-start; }
.modal-entry .modal-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
/* 抵消 .modal-footer-right 的全局 border/padding（见文件后部定义），避免底部出现双重分隔线 */
.modal-entry .modal-footer-right { padding: 0; border-top: none; }

.btn-secondary {
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.04);
}

.btn-primary {
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--blue);
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-danger {
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--red-light);
  color: var(--red);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.btn-danger:hover {
  background: var(--error-light);
}

/* 跟进快捷入口按钮：绿色底色，与新增(蓝)/取消(灰)区分 */
.btn-accent {
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--green);
  color: var(--white);
  border: 1px solid var(--green);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
}

.btn-accent:hover {
  opacity: 0.92;
}

/* ===== Search Panel ===== */
.search-panel {
  position: fixed;
  top: var(--toolbar-height);
  right: 24px;
  width: 420px;
  max-height: calc(100vh - var(--toolbar-height) - 48px);
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-3);
  z-index: var(--z-fixed);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.search-panel-header h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.search-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}

.search-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.search-results {
  overflow-y: auto;
  padding: 8px;
  max-height: 500px;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.search-result-item:hover {
  background: var(--bg);
}

.search-result-item.is-completed .result-content {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.result-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.result-content {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.result-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ===== Settings View (左右结构) ===== */
.settings-view {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  /* 2.1.1.41：本模块不参与浏览器滚动锚定（子页异步渲染导致高度突变会被自动补偿而整块偏移）。
     与 .content-area 的 overflow-anchor:none 双保险；不支持该属性的浏览器忽略。 */
  overflow-anchor: none;
  /* 2.1.1.42：面板最小高度 = 视口减顶栏。矮面板（外观/部门管理）也撑满一屏，
     使切换子页时 contentArea 的可滚动余量保持稳定，浅滚动位置（如滚了 30px）
     不会被钳制归零——配合「切子页不动滚动位置」实现零跳动。 */
  min-height: calc(100vh - var(--toolbar-height));
}

.settings-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  color: var(--text-primary);
}

.settings-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.perm-hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== 字段管理 ===== */
.sub-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.sub-tab {
  border: 1px solid var(--border);
  background: var(--white);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.sub-tab:hover {
  color: var(--blue);
  background: var(--blue-light);
  border-color: var(--blue);
  transform: translateY(-1px);
}
.sub-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.25);
}

.field-mgmt-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}
.field-entity-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 60px;
  animation: fadeInContent 0.22s ease;
}
@keyframes fadeInContent {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.field-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.field-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.field-group-title { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.field-add-btn { padding: 5px 12px; font-size: 13px; }
.field-options { display: flex; flex-direction: column; }
.field-empty { padding: 14px; color: var(--text-secondary); font-size: 13px; text-align: center; }
.field-option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.field-option-row:last-child { border-bottom: none; }
.field-color-dot {
  width: 14px; height: 14px; border-radius: 50%;
  flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
/* 无色字段的占位点：浅灰实心圆点，与有色圆点同尺寸，保证行对齐 */
.field-color-dot--empty {
  background: var(--border) !important;
  box-shadow: none;
  border: none;
}
.field-option-label {
  font-weight: 500;
  color: var(--text-primary);
  min-width: 90px;
  flex: 0 0 auto;
}
.field-option-value {
  color: var(--text-secondary);
  font-size: 12px;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  min-width: 70px;
  flex: 0 0 auto;
}
.field-active {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
  flex: 0 0 auto;
}
.field-active.on { background: var(--green-light); color: var(--green-dark); }
.field-active.off { background: var(--red-light); color: var(--error-dark); }
.field-option-actions { margin-left: auto; display: flex; gap: 6px; }
.field-option-actions .user-action-btn { padding: 4px 10px; font-size: 12px; }

/* 选项编辑 Modal 遮罩 —— 专用遮罩，不复用通用 .modal-overlay（默认 display:none） */
.field-option-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(32, 33, 36, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-special);
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  width: 420px; max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; gap: 14px;
}
.modal-title { font-family: var(--font-heading); font-weight: 600; font-size: 16px; color: var(--text-primary); }
.modal-form { display: flex; flex-direction: column; gap: 6px; }
.modal-label { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.modal-label .req { color: var(--error-dark); margin-left: 2px; }
.modal-check { display: flex; align-items: center; gap: 6px; color: var(--text-primary); }
.modal-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
}
.modal-input:focus { border-color: var(--blue); }
.modal-input:disabled { background: var(--surface-2); color: var(--text-secondary); }
.modal-color { width: 48px; height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--surface, #fff); cursor: pointer; }
.modal-msg { min-height: 16px; color: var(--error-dark); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* User Add Form */
.user-add-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.user-add-fields input,
.user-add-fields select {
  flex: 1;
  min-width: 120px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease);
}

.user-add-fields input:focus,
.user-add-fields select:focus {
  border-color: var(--blue);
}

.user-add-fields .btn-primary {
  flex: 0 0 auto;
}

/* User Table */
.user-table {
  display: flex;
  flex-direction: column;
}

.user-table-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.user-row:last-child {
  border-bottom: none;
}

.user-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-row-info {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-row-username {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* 职位列：固定列宽容器（与表头对齐），胶囊按内容自适应宽度并居中；
   职位名可自定义，原 60px 定宽会把「超级管理员」等折成两行，故改为「固定宽容器 + 内容宽胶囊 + 省略号」。 */
.user-row-role-cell {
  width: 104px;
  flex-shrink: 0;
  text-align: center;
  overflow: hidden;
}

.user-row-role {
  display: inline-block;
  max-width: 100%;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.user-row-role.admin {
  background: var(--blue-light);
  color: var(--blue);
}

.user-row-role.employee {
  background: var(--surface-2);
  color: var(--text-secondary);
}

.user-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  width: 190px;
  justify-content: flex-end;
}

.user-action-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-action-btn.reset {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.user-action-btn.reset:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.user-action-btn.delete {
  background: var(--red-light);
  color: var(--red);
}

.user-action-btn.delete:hover {
  background: var(--error-light);
}

.user-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.user-action-btn.edit {
  background: var(--blue-light);
  color: var(--blue);
}

.user-action-btn.edit:hover {
  background: var(--blue-light);
}

/* Personal Info */
.personal-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.personal-info-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  width: 80px;
  flex-shrink: 0;
}

.personal-info-value {
  font-size: 14px;
  color: var(--text-primary);
}

.personal-info-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.personal-info-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue); /* 2.1.2-beta4：无图时的兜底底色（原来只靠 JS 内联，丢了就白字白底看不见） */
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.personal-info-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.personal-info-edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  margin-bottom: 12px;
}

.personal-info-edit-row .personal-info-label {
  margin-bottom: 0;
}

.personal-info-input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease);
}

.personal-info-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.personal-info-save-btn {
  margin-top: 16px;
}

/* Password Change */
.pwd-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwd-fields input {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease);
}

.pwd-fields input:focus {
  border-color: var(--blue);
}

.pwd-msg {
  font-size: 13px;
  min-height: 20px;
}

.pwd-msg.success {
  color: var(--green);
}

.pwd-msg.error {
  color: var(--red);
}

/* ===== App Footer ===== */
.app-footer {
  flex-shrink: 0;
  height: 40px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 12px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-app-name {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-version {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 11px;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.footer-version-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-copy {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Login/Setup footer version */
.login-footer {
  text-align: center;
  margin-top: 20px;
}

.login-footer-version {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.login-tip {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--warn-text);
}

/* ===== Data Management ===== */
.data-mgmt-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.data-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
}

.data-info-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.data-info-value {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.data-mgmt-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.data-mgmt-restore {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.data-restore-row {
  display: flex;
  gap: 12px;
}

.data-restore-row select {
  flex: 1;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}

.data-restore-row select:focus {
  border-color: var(--blue);
}

.data-mgmt-msg {
  font-size: 13px;
  min-height: 20px;
}

.data-mgmt-msg.success {
  color: var(--green);
}

.data-mgmt-msg.error {
  color: var(--red);
}

/* ===== Settings Tabs (左侧卡片式侧边栏) ===== */
.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 200px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 8px;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 16px;
  align-self: flex-start;
}

.settings-tabs-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  padding: 4px 14px 8px;
  text-transform: uppercase;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.settings-tab .tab-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-tab .tab-ico svg {
  width: 16px;
  height: 16px;
  display: block;
}

.settings-tab .tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-tab:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.settings-tab.active {
  color: var(--blue);
  background: var(--blue-light);
  border-left-color: var(--blue);
}

.settings-tab.active .tab-ico {
  color: var(--blue);
}

.settings-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 0 1 auto;
  width: 100%;
  max-width: 860px;
  min-width: 0;
}

/* 权限审计矩阵需要宽屏展示，豁免 max-width 限制 */
#tabPanel-permsaudit {
  max-width: none;
}

/* ===== 审计日志（2.1.1.77）===== */
/* 六列表格同样需要宽屏，豁免 max-width 限制 */
#tabPanel-auditlog {
  max-width: none;
}
.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.audit-log-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.audit-log-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: top;
  word-break: break-all;
}
.audit-log-table td.time {
  white-space: nowrap;
  color: var(--text-tertiary);
}
.audit-log-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: var(--blue-light);
  color: var(--blue);
  white-space: nowrap;
}
.audit-log-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== 权限管理矩阵 ===== */
.perm-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* 编辑弹窗内敏感字段只读提示 */
.field-perm-hint {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}
/* 敏感字段禁用态 */
.field-disabled {
  background: var(--surface-2) !important;
  color: var(--text-tertiary) !important;
  cursor: not-allowed !important;
  border-color: var(--border) !important;
}

/* ===== 权限分配审计 ===== */
.perm-audit-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 12px;
}
.perm-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.perm-audit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, var(--border));
  border-radius: 10px;
  background: var(--surface, #fff);
  font-size: 13px;
}
.perm-audit-badge {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
}
.perm-audit-badge.grant { background: var(--green-dark); }
.perm-audit-badge.revoke { background: var(--red); }
.perm-audit-text { flex: 1 1 auto; color: var(--text, #202124); }
.perm-audit-meta {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-secondary, var(--text-tertiary));
}
.perm-matrix {
  overflow-x: auto;
  margin: 4px 0 8px;
}
.perm-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
  font-size: 14px;
}
.perm-table th, .perm-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.perm-table thead th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
}
.perm-table tbody td:first-child {
  font-weight: 500;
  color: var(--text-primary);
}
.perm-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--blue, var(--blue));
}
.perm-table input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.perm-lock {
  margin-left: 4px;
  font-size: 12px;
}
.perm-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.perm-msg {
  font-size: 13px;
  min-height: 18px;
}

/* ===== 职位管理（Position Management）—— 左右结构 ===== */
.position-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
}
.position-list-col { flex: 0 0 380px; min-width: 0; }
.position-form-col { flex: 1 1 auto; min-width: 0; }
.position-form-card { min-height: 200px; }
.position-toolbar { margin-bottom: 14px; }
.position-list { display: flex; flex-direction: column; gap: 10px; }
.position-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--bg, #fff);
  border: 1px solid var(--border, var(--border)); border-radius: 10px;
  cursor: pointer; transition: box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.position-row:hover {
  box-shadow: var(--shadow-2); border-color: rgba(52,152,219,0.25);
}
.position-row.active {
  border-color: var(--blue); background: rgba(52,152,219,0.03);
}
.position-row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.position-name { font-size: 15px; font-weight: 600; color: var(--text, #202124); }
.position-type {
  font-size: 12px; padding: 1px 8px; border-radius: 10px;
  background: var(--surface-2); color: var(--text-secondary);
}
.position-type.custom { background: var(--blue-light); color: var(--blue); }
.position-tag {
  font-size: 12px; padding: 1px 8px; border-radius: 10px; font-weight: 600;
}
.position-tag.admin { background: var(--green-light); color: var(--green-dark); }
.position-tag.supervisor { background: var(--purple-light); color: var(--purple); }
.position-tag.pos-super_admin { background: var(--state-danger-bg, #FCE8E6); color: var(--state-danger, #C5221F); }
.position-tag.pos-admin { background: var(--blue-light); color: var(--blue); }
.position-tag.pos-supervisor { background: var(--purple-light); color: var(--purple); }
.position-tag.pos-employee { background: var(--surface-2); color: var(--text-secondary); }
/* 级别分区卡片 */
.level-section { padding: 14px 16px; background: var(--bg, #f8f9fa); border: 1px solid var(--border, #e0e0e0); border-radius: 12px; }
.level-section-label { font-size: 13px; font-weight: 600; color: var(--text-secondary, #5f6368); margin-bottom: 10px; }
/* 级别胶囊选择器 */
.level-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.level-pill {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 22px; border: 1.5px solid var(--border, #e0e0e0);
  background: var(--surface, #fff); font-size: 14px; color: var(--text, #202124); cursor: pointer;
  transition: all .15s ease; user-select: none;
}
.level-pill input { position: absolute; opacity: 0; pointer-events: none; }
.level-pill:hover { border-color: var(--blue); }
.level-pill.selected { border-color: var(--blue); background: var(--blue-light, #e8f0fe); color: var(--blue); font-weight: 600; }
.level-pill.selected::after { content: '✓'; margin-left: 2px; font-size: 12px; }
.level-desc { font-size: 12px; color: var(--text-secondary, #5f6368); margin-top: 10px; line-height: 1.5; }
.perm-summary {
  font-size: 13px; color: var(--text-secondary); background: var(--bg, #f8f9fa);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
}
/* 用户编辑：可管理部门多选 */
.dept-multiselect { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 160px; overflow: auto; padding: 8px 10px; background: var(--bg, #fff); border: 1px solid var(--border); border-radius: 10px; }
.dept-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.dept-check input { width: 15px; height: 15px; accent-color: var(--blue); }
.position-row-actions { display: flex; gap: 8px; }

.position-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.position-perm-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-top: 4px; }
.position-perm-checks {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px;
  padding: 12px 14px; background: var(--bg, #fff);
  border: 1px solid var(--border, var(--border)); border-radius: 10px;
}
.position-perm-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text, #202124); }
.position-flag { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text, #202124); cursor: pointer; }

/* 2.0.4.43：功能权限矩阵 —— 二级（操作级）子权限 */
.position-perm-group { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.position-perm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.perm-toggle-btn {
  border: 1px solid var(--border); background: var(--bg, #fff); color: var(--text-secondary);
  font-size: 12px; padding: 2px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.perm-toggle-btn:hover { border-color: var(--blue); color: var(--blue); }
.position-perm-subs {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px; margin-left: 22px;
  background: var(--bg-secondary, #f8f9fa); border: 1px dashed var(--border); border-radius: 8px;
}
.perm-sub-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.perm-sub-btn {
  border: 1px solid var(--border); background: var(--surface, #fff); color: var(--text-secondary);
  font-size: 12px; padding: 2px 10px; border-radius: 6px; cursor: pointer; transition: all .15s;
}
.perm-sub-btn:hover { border-color: var(--blue); color: var(--blue); background: #f0f7ff; }
.perm-sub-btn.primary { border-color: var(--blue); color: var(--blue); background: #f0f7ff; }
.perm-sub-btn.danger { border-color: var(--state-danger, #d93025); color: var(--state-danger, #d93025); background: var(--state-danger-bg, #fce8e8); }
.perm-sub-btn.safe { border-color: var(--state-ok, #137333); color: var(--state-ok, #137333); background: var(--state-ok-bg, #e6f4ea); }
.perm-sub-note { font-size: 12px; color: var(--text-secondary); opacity: .85; }

/* 子权限按风险级别分组 */
.perm-sub-section { display: flex; flex-direction: column; gap: 6px; }
.perm-sub-section-title {
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 0;
}
.perm-sub-section-title.daily { color: var(--state-ok, #137333); }
.perm-sub-section-title.data { color: var(--state-warn, #b06000); }
.perm-sub-section-title.danger { color: var(--state-danger, #c5221f); }
.perm-sub-section-title .perm-risk-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}
.perm-sub-section-title.daily .perm-risk-dot { background: var(--state-ok-solid, #34a853); }
.perm-sub-section-title.data .perm-risk-dot { background: var(--state-warn-solid, #f9ab00); }
.perm-sub-section-title.danger .perm-risk-dot { background: var(--state-danger-solid, #ea4335); }

.perm-sub-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.position-perm-subitem {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text, #202124);
  padding: 3px 8px; border-radius: 6px; transition: background .15s;
}
.position-perm-subitem:hover { background: rgba(0,0,0,.04); }
.position-perm-subitem.daily { border-left: 3px solid var(--state-ok-solid, #34a853); padding-left: 6px; }
.position-perm-subitem.data { border-left: 3px solid var(--state-warn-solid, #f9ab00); padding-left: 6px; }
.position-perm-subitem.danger { border-left: 3px solid var(--state-danger-solid, #ea4335); padding-left: 6px; }
.position-perm-subitem input { width: 15px; height: 15px; accent-color: var(--blue); }
.position-perm-subitem input:disabled { opacity: .45; }

/* 权限统计与复制 */
.perm-copy-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 10px; background: #e8f0fe; border-radius: 8px; font-size: 13px; }
.perm-copy-row select { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); font-size: 13px; }
.perm-copy-row button { padding: 3px 12px; border-radius: 6px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font-size: 12px; cursor: pointer; }
.perm-copy-row button:disabled { opacity: .5; cursor: not-allowed; }
.perm-summary-bar { font-size: 12px; color: var(--text-secondary); padding: 2px 0; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .search-box {
    width: 160px;
  }
  /* 中等宽度：整体收紧，避免顶栏拥挤 */
  .toolbar { padding: 0 14px; gap: 10px; }
  .toolbar-left { gap: 10px; }
  .toolbar-right { gap: 8px; }
  .date-range { font-size: 14px; }
}

@media (max-width: 900px) {
  .sidebar {
    width: 64px;
    padding: 16px 8px;
  }
  .logo-text, .nav-label, .nav-item span, .profile-info, .profile-chevron {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 0;
  }
  .profile-section {
    justify-content: center;
    padding: 0;
  }
  /* 提前启用手机端导航（避免 769~900px 区间顶栏标题消失的真空） */
  .toolbar { display: none !important; }
  .mobile-bottom-nav { display: flex; }
  /* 顶栏同样左对齐且固定到视口顶部（☰ 与"工作OA"同行靠左，不跑到右侧） */
  .mobile-topbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    height: 52px;
    padding: 0 14px;
    padding-top: env(safe-area-inset-top);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }

  /* 内容区 section 头部：窄屏下标题独占一行，操作/筛选按钮换行到下方（与 768px 段保持一致） */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .section-header > button,
  .section-header > .section-meta,
  .section-header > .project-list-actions,
  .section-header > .customer-top-actions,
  .section-header > .history-filter { width: 100%; }
  .profile-dropdown {
    left: 100%;
    bottom: 0;
    width: 220px;
    right: auto;
  }
  .week-row {
    flex-direction: column;
  }
  .stats-row {
    flex-wrap: wrap;
  }
  .stat-card {
    min-width: calc(33.333% - 8px);
  }
  .search-box {
    display: none;
  }
  /* ⚠ 原为全局 .user-filter{display:none!important}，但 .user-filter 实为「通用表单控件」样式，
     被 mold/product/ship-spec/field-dict 等模块当作 input/select/textarea 的类复用
     （如 #mlCode、#peName、#ssCust、#cfNewLabel…）。全局隐藏会导致手机端这些
     表单字段全部不渲染、模块无法编辑。
     现只隐藏顶栏内的筛选（而 .toolbar 本身在窄屏已整体隐藏，此条仅为显式表达意图）。 */
  .toolbar .user-filter { display: none; }
  .user-add-fields input,
  .user-add-fields select {
    min-width: 100%;
  }
}

/* ===== Site Maintenance Mode ===== */
/* 登录页维护提示横幅 */
.login-maintenance-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  color: var(--warn-text);
  font-size: 13px;
  line-height: 1.5;
}
.login-maintenance-bar svg { flex-shrink: 0; margin-top: 2px; }

/* 维护提示页（复用 login-page 全屏容器） */
.maintenance-card { text-align: center; }
.maintenance-logo-icon { background: var(--red-light, #FCE8E6); }
.maintenance-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 10px 14px;
  background: var(--red-light, #FCE8E6);
  border: 1px solid var(--error-light);
  border-radius: 8px;
  color: var(--error-dark);
  font-size: 13px;
}
.maintenance-card .login-btn { width: 100%; }

/* 顶部维护横幅（管理员可见） */
.maintenance-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-modal-low);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn-text);
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(138, 90, 0, 0.08);
}
.maintenance-top-bar svg { flex-shrink: 0; }
.maintenance-top-close {
  margin-left: auto;
  padding: 4px 12px;
  border: 1px solid var(--warn-border);
  border-radius: 6px;
  background: var(--white);
  color: var(--warn-text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.maintenance-top-close:hover { background: var(--warn-bg); }

/* 设置中心：维护模式表单 */
.maintenance-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
  margin-top: 16px;
}
.maintenance-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, var(--border));
  border-radius: 10px;
}
.maintenance-switch-label { font-size: 14px; font-weight: 500; color: var(--text, #202124); }
.maintenance-message-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.maintenance-message-input {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--border, var(--border));
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary, #202124);
  transition: border-color 0.15s var(--ease);
}
.maintenance-message-input:focus { border-color: var(--blue, var(--blue)); }

/* 开关控件 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--text-tertiary);
  border-radius: 24px;
  transition: background 0.2s var(--ease);
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .switch-slider { background: var(--green, #34A853); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ===== Category Management (Settings) ===== */
.cat-mgmt-add-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.cat-mgmt-parent-select {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
  flex: 0 0 auto;
}

.cat-mgmt-parent-select:focus {
  border-color: var(--blue);
}

.cat-mgmt-add-row input {
  flex: 1;
  min-width: 160px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease);
}

.cat-mgmt-add-row input:focus {
  border-color: var(--blue);
}

.cat-mgmt-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.cat-mgmt-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-mgmt-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

.cat-mgmt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
  border: 1px solid transparent;
  user-select: none;
}

.cat-mgmt-row.is-child {
  margin-left: 24px;
  background: var(--white);
  border-color: var(--border);
}

.cat-mgmt-row:hover {
  background: var(--blue-light);
}

.cat-mgmt-row.is-child:hover {
  background: var(--blue-light);
}

.cat-mgmt-row.dragging {
  opacity: 0.4;
}

.cat-mgmt-row.drag-over {
  border-color: var(--blue);
  border-style: dashed;
  background: var(--blue-light);
}

.cat-mgmt-handle {
  color: var(--text-tertiary);
  cursor: grab;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.cat-mgmt-handle:active {
  cursor: grabbing;
}

.cat-mgmt-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.cat-mgmt-del-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  flex-shrink: 0;
}

.cat-mgmt-del-btn:hover {
  background: var(--red-light);
  color: var(--red);
}

.cat-mgmt-edit-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  flex-shrink: 0;
}

.cat-mgmt-edit-btn:hover {
  background: var(--blue-light);
  color: var(--blue);
}

/* ===== 行内编辑模式 ===== */
.cat-mgmt-row.editing {
  background: var(--blue-light);
  border-color: var(--blue);
}

.cat-mgmt-edit-color {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  background: none;
}

.cat-mgmt-edit-color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.cat-mgmt-edit-color::-webkit-color-swatch {
  border: 2px solid var(--border);
  border-radius: 6px;
}

.cat-mgmt-edit-input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  min-width: 0;
}

.cat-mgmt-edit-input:focus {
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.cat-mgmt-save-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: var(--blue);
  cursor: pointer;
  transition: background 0.15s var(--ease);
  flex-shrink: 0;
}

.cat-mgmt-save-btn:hover {
  background: var(--blue-dark, #1557B0);
}

.cat-mgmt-save-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.cat-mgmt-cancel-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  background: var(--bg);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  flex-shrink: 0;
}

.cat-mgmt-cancel-btn:hover {
  background: var(--red-light);
  color: var(--red);
}

.cat-mgmt-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ===== History View ===== */
.history-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-group {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.history-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.history-date {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.history-group-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.history-group-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.history-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s var(--ease);
  background: var(--user-bg, transparent);
}

.history-entry:last-child {
  border-bottom: none;
}

.history-entry:hover {
  background: var(--bg);
}

.history-entry:hover .entry-actions {
  display: flex;
}

.history-entry.is-completed .entry-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.history-entry.is-completed .entry-time {
  text-decoration: line-through;
  color: var(--text-disabled);
}

.entry-status-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.entry-status-tag.done {
  background: var(--green-light);
  color: var(--green);
}

.entry-status-tag.pending {
  background: var(--blue-light);
  color: var(--blue);
}

.history-empty {
  padding: 48px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ===== Stats View ===== */
.stats-cat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--card-shadow);
}

.stats-cat-name {
  width: 80px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex-shrink: 0;
}

.stats-cat-bar-wrap {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.stats-cat-bar {
  height: 100%;
  border-radius: 6px;
  min-width: 4px;
  transition: width 0.3s var(--ease);
  background: var(--cat-bg);
}

.stats-cat-meta {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.stats-trend-chart {
  display: flex;
  flex-direction: column;
}

.stats-trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 12px 8px;
  box-shadow: var(--card-shadow);
}

.stats-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.stats-trend-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  min-height: 14px;
}

.stats-trend-bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.stats-trend-bar {
  width: 70%;
  max-width: 28px;
  background: var(--blue-light);
  border-radius: 4px 4px 0 0;
  position: relative;
  overflow: hidden;
  min-height: 2px;
  transition: height 0.3s var(--ease);
}

.stats-trend-bar-done {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--green);
  border-radius: 0 0 4px 4px;
  transition: height 0.3s var(--ease);
}

.stats-trend-label {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.stats-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--card-shadow);
}

.stats-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.stats-user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stats-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.stats-user-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.stats-user-bar {
  width: 120px;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.stats-user-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.3s var(--ease);
}

.stats-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

/* ===== Responsive: History & Stats ===== */
@media (max-width: 900px) {
  .history-filter .user-filter {
    display: block !important;
  }
  .stats-cat-name {
    width: 60px;
  }
  .stats-user-bar {
    width: 60px;
  }
  .stats-trend-bars {
    height: 140px;
  }
  .stats-trend-label {
    font-size: 8px;
  }
  .stats-trend-count {
    font-size: 8px;
  }
}

/* ===== Project Module ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* 项目双模块：成品项目 / PCBA项目 */
.project-type-module {
  margin-bottom: 28px;
}
.project-type-module:last-child {
  margin-bottom: 0;
}
.project-type-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--primary, var(--blue));
}
.project-type-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text, #202124);
  margin: 0;
}
.project-type-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  border-radius: 10px;
  padding: 2px 10px;
  min-width: 24px;
  text-align: center;
}

.project-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}

.project-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-card-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.project-card-progress {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.project-card-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.project-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.project-card-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s var(--ease);
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* 客户详情视图：位于 #app 之外（body 直接子元素），必须脱离文档流全屏覆盖 */
#customerDetailView.detail-view {
  position: fixed;
  top: 0;
  left: var(--sidebar-width, 256px);
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width, 256px));
  height: 100%;
  overflow-y: auto;
  background: var(--surface-2);
  z-index: var(--z-sticky);
}
.project-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

/* 客户详情页头（2.1.4-beta8）
   #customerDetailView 复用了 .project-detail-header，但项目详情里「标题撑开、动作靠右」
   其实是靠 .project-layout 作用域的一条规则实现的（标题 flex:1 1 auto）。
   客户详情不在 .project-layout 内 → 那条不生效 → 返回 / 标题 / 编辑 / 认领 四个元素
   全挤在左边，窄屏还会横向溢出。
   ⚠ 不能把 flex 提到全局 .project-detail-header 上：项目详情页头的 #projectDetailName
     靠的正是 .project-layout 那条，改成全局会连带改变 badge 与关闭按钮的间距。
   只给客户详情单独的 id 作用域，项目详情零变化。 */
#customerDetailView .project-detail-header {
  flex-wrap: wrap;
  row-gap: 8px;
}
#customerDetailView .project-detail-header > #customerDetailTitle {
  flex: 1 1 auto;
  min-width: 0;
}

.project-status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 12px;
}

.project-detail-body {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

.project-detail-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-detail-right {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  min-height: 400px;
}

.project-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.project-info-row .data-info-label {
  flex-shrink: 0;
  width: 80px;
}

.project-info-row .data-info-value {
  text-align: right;
  word-break: break-all;
}

.project-progress-section {
  margin-top: 16px;
}

.project-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-progress-bar {
  height: 12px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.project-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.3s var(--ease);
}

.project-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Project Members */
.project-members {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg);
}

.project-add-member {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Project Entries */
.project-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-entry-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  border-left: 3px solid var(--accent);
}

.project-entry-date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.project-entry-content {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.project-entry-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.project-entry-user {
  color: var(--text-secondary);
}

/* Project Modal */
.project-member-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.member-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
}

/* Supervisor role badge */
.role-badge.supervisor {
  background: var(--purple-light);
  color: var(--purple);
}

.user-row-role.supervisor {
  background: var(--purple-light);
  color: var(--purple);
}

/* ===== Department Management ===== */
.dept-add-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.dept-add-row input {
  flex: 1;
  min-width: 180px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease);
}
.dept-add-row input:focus {
  border-color: var(--blue);
}
.dept-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dept-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  transition: background 0.15s var(--ease);
}
.dept-row:hover {
  background: var(--blue-light);
}
.dept-row-info {
  flex: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 4px;
  min-width: 0;
}
.dept-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.dept-row-count {
  font-size: 12px;
  color: var(--text-tertiary);
}
/* 管理者信息块：独占一行（管理员 + 主管分行胶囊，人多为时允许折行） */
.dept-row-mgrs {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.dept-row-mgrs.is-none {
  color: var(--text-tertiary);
}
.dept-mgr-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.dept-mgr-tag {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
}
.dept-mgr-tag.admin {
  background: var(--blue-light);
  color: var(--blue);
}
.dept-mgr-tag.supervisor {
  background: var(--purple-light);
  color: var(--purple);
}
.dept-mgr-names {
  min-width: 0;
}
.dept-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.dept-edit-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 14px;
  color: var(--text-primary);
}
.dept-edit-input:focus {
  outline: none;
  border-color: var(--blue);
}
/* 2.0.4.36：负责人下拉（新建部门与编辑态共用），与输入框同高以保持行内对齐 */
.dept-edit-select {
  flex: 0 1 140px;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 6px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-secondary, #fff);
}
.dept-edit-select:focus { outline: none; border-color: var(--blue); }

/* ===== Patent management ===== */
.patent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.patent-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.patent-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.patent-card-header {
  margin-bottom: 10px;
}
.patent-card-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}
.patent-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.4;
}
.patent-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.patent-card-type {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
}
.patent-card-no {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}
.patent-card-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
/* Modal footer left (delete button area) */
.modal-footer-left {
  display: flex;
  gap: 8px;
}
/* Textarea inside form-field */
.form-field textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.15s var(--ease);
}
.form-field textarea:focus {
  outline: none;
  border-color: var(--blue);
}

/* ===== User row department cell ===== */
.user-row-dept {
  width: 90px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Project list actions (year filter) ===== */
.project-list-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-card-start {
  color: var(--blue);
}

/* ===== Success button (mark project complete) ===== */
.btn-success {
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--green-dark);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s var(--ease);
}
.btn-success:hover {
  opacity: 0.92;
}

/* Responsive */
@media (max-width: 900px) {
  .project-detail-body {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 客户管理 ===== */
.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.customer-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.customer-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.customer-card-header {
  margin-bottom: 10px;
}
.customer-card-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}
.customer-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.4;
}
.customer-card-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.customer-card-owner {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.customer-card-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 16px;
  border-radius: 10px;
  background: var(--bg-secondary, var(--surface-2));
  color: var(--text-secondary, var(--text-secondary));
  border: 1px solid var(--border-color, var(--border));
}

.tag-chip-imp {
  background: var(--blue-light);
  color: var(--blue);
  border-color: var(--blue-light);
}

.customer-card-followup {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.customer-card-followup-empty {
  color: var(--text-tertiary);
}
.customer-card-remind {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.customer-card-remind-due {
  color: var(--warn-text);
  background: var(--warn-bg);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
}

/* ===== 客户列表：表格视图 + 列设置 ===== */
.customer-table-wrap { margin-top: 16px; }
.customer-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}
.customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 760px;
}
.customer-table thead th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.customer-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
}
.customer-table tbody tr:last-child td { border-bottom: none; }
.customer-table tbody tr:hover { background: var(--bg); cursor: pointer; }
.customer-table-empty { text-align: center; color: var(--text-tertiary); padding: 44px 0; }
.cust-name { font-weight: 600; color: var(--text-primary); }
.cust-muted { color: var(--text-tertiary); }
.cust-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.cust-remind-due { color: var(--warn-text); font-weight: 600; }

/* ===== 2.0.4.45：客户管理双栏布局 + 标签维度 ===== */
/* 2.1.3-beta11：左栏原固定 232px → clamp。1440 屏≈230px（与旧值一致），
   1920 放宽到 264px，1024 平板收到 200px 给右栏内容让位。
   窄屏/备忘录/历史等变体在各自的 @media 里覆盖为 1fr 或自己的列数，不受影响。 */
.cust-layout { display: grid; grid-template-columns: clamp(200px, 16vw, 264px) 1fr; gap: 18px; align-items: start; }
.cust-sidebar {
  background: var(--white, #fff); border: 1px solid var(--border, #e3e6ea); border-radius: 12px;
  padding: 14px 12px; position: sticky; top: 16px; max-height: calc(100vh - 120px); overflow-y: auto;
}
.cust-sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 4px; }
.cust-sidebar-title { font-size: 16px; font-weight: 600; color: var(--text-primary, #202124); }
.cust-nav { display: flex; flex-direction: column; gap: 2px; }
.cust-nav-group { font-size: 12px; color: var(--text-tertiary, #9aa0a6); font-weight: 600; margin: 14px 6px 4px; }
.cust-nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: none; background: transparent; border-radius: 8px; padding: 8px 10px;
  font-size: 13px; color: var(--text-primary, #202124); cursor: pointer; transition: background .15s, color .15s;
}
.cust-nav-item:hover { background: #f1f3f4; }
.cust-nav-item.active { background: #e8f0fe; color: var(--blue); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.cust-nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-nav-badge { font-size: 11px; color: var(--text-tertiary, #9aa0a6); background: #f1f3f4; border-radius: 10px; padding: 1px 8px; min-width: 20px; text-align: center; }
.cust-nav-item.active .cust-nav-badge { color: var(--blue); background: #d2e3fc; }
.cust-nav-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.cust-sidebar-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border, #e3e6ea); }
.cust-content { min-width: 0; }
.cust-tag-chip {
  display: inline-block; font-size: 12px; line-height: 1; padding: 3px 9px; margin: 1px 4px 1px 0;
  border: 1px solid var(--blue); border-radius: 10px; vertical-align: middle; white-space: nowrap;
}

/* ===== 2.1.0.2：标签分组（左导航组名行 / 筛选与打标弹层的分组小标题）===== */
.cust-nav-taggroup { font-weight: 600; }
.cust-nav-taggroup .cust-nav-label { font-weight: 600; color: var(--text, #202124); }
.cust-nav-taggroup.active .cust-nav-label { color: var(--blue); }
.cust-chooser-group {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary, #9aa0a6);
  padding: 6px 0 2px; margin-top: 4px; letter-spacing: .3px;
}
.cust-chooser-group:first-child { margin-top: 0; padding-top: 0; }

/* ===== 2.1.0.5 外观优化 A1：客户模块新增组件的暗色适配 ===== */
/* 2.1.0.1 / 2.1.0.2 新增的联系人、扩展字段、自定义字段面板含硬编码浅色，
   暗色主题（2.0.4.30 起）下会出现「浅底浅字」。此处统一用语义变量覆盖，
   与项目既有的 [data-theme="dark"] 补救写法保持一致，不动原样式。 */
[data-theme="dark"] .cust-contact-row { background: var(--bg-secondary); border-color: var(--border); }
[data-theme="dark"] .cust-contact-row:hover { background: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .cust-contact-row.is-primary { background: var(--blue-light); border-color: var(--blue); }
[data-theme="dark"] .cust-contact-sub { color: var(--text-secondary); }
[data-theme="dark"] .cust-contact-badge { color: var(--blue-dark); background: var(--blue-light); }
[data-theme="dark"] .cust-extra-input { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--border); }
[data-theme="dark"] .cust-extra-label { color: var(--text-secondary); }
[data-theme="dark"] .cf-hint { background: var(--bg-secondary); color: var(--text-secondary); }
[data-theme="dark"] .cf-row { background: var(--bg-secondary); }
[data-theme="dark"] .tag-manage-row { background: var(--bg-secondary); }
[data-theme="dark"] .cust-chooser-group { color: var(--text-tertiary); }

/* ===== 2.1.0.6 结构优化 S2：筛选栏折叠（次级项收进「更多筛选」） ===== */
.cust-filter-more { display: none; }
.customer-filter-bar.expanded .cust-filter-more { display: inline-block; }
/* 宽屏空间充足：直接全展开，并隐藏「更多筛选」按钮 */
@media (min-width: 1400px) {
  .cust-filter-more { display: inline-block; }
  #custMoreFilterBtn { display: none; }
}

/* ===== 2.1.0.6：待跟进入口的红色徽标（提醒优先处理） ===== */
.cust-nav-item.is-remind .cust-nav-badge { background: var(--state-danger-bg, #fce8e6); color: var(--state-danger, #c5221f); font-weight: 600; }
.cust-nav-item.is-remind.active .cust-nav-badge { background: var(--state-danger, #c5221f); color: #fff; }

/* ===== 2.1.0.7 S1：详情「协作与分类」区（负责人 + 参与人 + 标签） ===== */
.cust-collab-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border, #e3e6ea); }
.cust-collab-row:last-child { border-bottom: none; padding-bottom: 0; }
.cust-collab-label { flex: 0 0 56px; font-size: 12px; color: var(--text-tertiary, #9aa0a6); padding-top: 2px; }
.cust-collab-value { font-size: 13px; font-weight: 600; color: var(--text, #202124); }
.cust-collab-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cust-collab-body .cust-detail-tags { flex: 1; min-width: 0; margin-bottom: 0; }

/* ===== 2.1.0.7 F4：客户 360 统一时间线 ===== */
.cust-timeline { display: flex; flex-direction: column; }
.cust-timeline-empty { padding: 16px; text-align: center; color: var(--text-tertiary, #9aa0a6); font-size: 13px; }
.cust-timeline-item { position: relative; padding: 10px 0 10px 18px; border-left: 2px solid var(--border, #e3e6ea); }
.cust-timeline-item::before {
  content: ''; position: absolute; left: -6px; top: 15px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--border, #e3e6ea);
}
.cust-timeline-item.is-followup::before { background: var(--blue, #1a73e8); }
.cust-timeline-item.is-status::before { background: var(--green, #34a853); }
.cust-timeline-item.is-audit::before { background: var(--orange, #f9ab00); }
.cust-timeline-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.cust-timeline-tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 9px; line-height: 1.5; }
.cust-timeline-item.is-followup .cust-timeline-tag { color: var(--blue, #1a73e8); background: var(--blue-light, #e8f0fe); }
.cust-timeline-item.is-status .cust-timeline-tag { color: var(--state-ok, #137333); background: var(--state-ok-bg, #e6f4ea); }
.cust-timeline-item.is-audit .cust-timeline-tag { color: var(--state-warn, #b06000); background: var(--state-warn-bg, #fef7e0); }
.cust-timeline-time { font-size: 11px; color: var(--text-tertiary, #9aa0a6); }
.cust-timeline-text { font-size: 13px; color: var(--text, #202124); line-height: 1.6; overflow-wrap: anywhere; }
.cust-timeline-meta { font-size: 11px; color: var(--text-tertiary, #9aa0a6); margin-top: 3px; }

/* ===== 2.1.0.8 外观优化 A3：客户统计卡状态色条 + 悬停反馈 ===== */
#customerDashboard .stat-card { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
#customerDashboard .stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
#customerDashboard .stat-card:nth-child(1)::before { background: var(--blue, #1a73e8); }    /* 客户总数 */
#customerDashboard .stat-card:nth-child(2)::before { background: var(--orange, #f9ab00); } /* 有意向 */
#customerDashboard .stat-card:nth-child(3)::before { background: var(--green, #34a853); }  /* 合作中 */
#customerDashboard .stat-card:nth-child(4)::before { background: #c5221f; }                 /* 已丢失 */
#customerDashboard .stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .10); }
[data-theme="dark"] #customerDashboard .stat-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }

/* ===== 2.1.2-beta7：客户「本月新增」趋势改为卡片右上角标注 =====
   根因：theme-pro 把 .stat-card 改成 height:auto（按内容自适应），而本卡比其他模块
   多一行 .stat-trend → 被撑高；又因 .stats-row 是 flex（默认 align-items:stretch），
   整排 4 张卡全被拉高，与项目/产品等模块（label + 数值 两行）不一致。
   改法：绝对定位到右上角，脱离文档流 → 卡片恢复两行高度，与其它模块完全对齐。
   nowrap + 省略号保证窄卡也不换行、不撑高。 */
#customerDashboard .stat-trend {
  position: absolute; top: 10px; right: 12px; margin: 0;
  font-size: 11px; line-height: 1.3; max-width: 64%;
  text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 小屏卡片 padding 收窄为 8px 10px（theme-pro 2.1.1.39），趋势标注同步贴角 */
@media (max-width: 900px) {
  #customerDashboard .stat-trend { top: 8px; right: 10px; font-size: 10px; max-width: 62%; }
}

/* ===== 2.1.1.4 A6：移动端客户表格卡片化 =====
   窄屏（<900px）下表格列太多必然横向溢出，改为「一行一张卡片」：
   表头隐藏，每格用 data-label 的列名作为左侧小标签，值右对齐，复选框移到卡片右上角。 */
@media (max-width: 900px) {
  .cust-content .customer-table,
  .cust-content .customer-table tbody,
  .cust-content .customer-table tr,
  .cust-content .customer-table td { display: block; width: 100%; }
  .cust-content .customer-table thead { display: none; }
  .cust-content .customer-table tr {
    position: relative;
    margin-bottom: 10px; padding: 10px 12px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e8eaed);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  }
  .cust-content .customer-table tr:hover { background: var(--bg-primary, #fff); }
  .cust-content .customer-table td {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
    padding: 5px 0; border: none; font-size: 13px; text-align: left; word-break: break-word;
  }
  .cust-content .customer-table td::before {
    content: attr(data-label);
    flex: 0 0 76px;
    color: var(--text-secondary, #5f6368); font-size: 12px;
  }
  /* 复选框列：不参与标签化，固定在卡片右上角 */
  .cust-content .customer-table td.cust-col-check {
    position: absolute; top: 10px; right: 10px;
    width: auto; padding: 0;
  }
  .cust-content .customer-table td.cust-col-check::before { content: none; }
  /* 客户名作为卡片标题：加粗并留出右上角复选框的位置 */
  .cust-content .customer-table td[data-label="客户名称"] { font-weight: 600; padding-right: 28px; }
  .cust-content .customer-table td[data-label="客户名称"] .cust-name { font-size: 14px; }
}

/* ===== 2.1.1.3 A3②：统计卡环比趋势 ===== */
.stat-trend { display: block; margin-top: 4px; font-size: 12px; color: var(--text-secondary, #5f6368); }
.stat-trend.is-up { color: var(--success, #137333); }
.stat-trend.is-down { color: var(--danger, #c5221f); }
.stat-trend.is-flat { color: var(--text-secondary, #5f6368); }

/* ===== 2.1.1.1：修复「从其他职位复制权限」区域文字竖排错乱 =====
   根因：.perm-copy-row 是 repeat(2, minmax(0,1fr)) 网格的子项却未声明跨列，
   被压进约 200px 的单轨道；行内 4 个 flex 子项又全部可收缩且无 nowrap，
   中文被逐字换行成竖排。跨整行 + 防挤压 + 统计文字独占一行。 */
.perm-copy-row { grid-column: 1 / -1; flex-wrap: wrap; row-gap: 6px; }
.perm-copy-row > span:first-child { white-space: nowrap; flex-shrink: 0; }
.perm-copy-row button { white-space: nowrap; flex-shrink: 0; }
.perm-copy-row select { min-width: 160px; flex: 1 1 160px; }
#permSummaryText { flex-basis: 100%; font-size: 12px; color: var(--text-secondary, #5f6368); }

/* ===== 2.1.1.0 F6：站内消息铃铛 ===== */
.notif-wrap { position: relative; }
.notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger, #c5221f); color: #fff;
  border-radius: 8px; font-size: 11px; line-height: 16px; text-align: center;
  pointer-events: none;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-popover);
  width: 320px; max-height: 420px; overflow: hidden;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
  display: flex; flex-direction: column;
}
.notif-dropdown-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border-color, #e8eaed);
  font-size: 13px; font-weight: 600;
}
.notif-dropdown-list { overflow-y: auto; max-height: 360px; }
.notif-item {
  display: flex; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--border-color, #f1f3f4);
  cursor: pointer; transition: background .15s;
}
.notif-item:hover { background: var(--bg-secondary, #f8f9fa); }
.notif-item.unread { background: rgba(26, 115, 232, .06); }
.notif-item.unread .notif-title { font-weight: 600; }
.notif-icon { font-size: 16px; line-height: 1.3; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; color: var(--text-primary, #202124); }
.notif-content { font-size: 12px; color: var(--text-secondary, #5f6368); margin-top: 2px; word-break: break-word; }
.notif-time { font-size: 11px; color: var(--text-muted, #9aa0a6); margin-top: 4px; }
.notif-loading, .notif-empty { padding: 24px 12px; text-align: center; font-size: 12px; color: var(--text-secondary, #5f6368); }

/* ===== 2.1.1.0 F6：公海规则设置 ===== */
.pool-rule-row { margin-bottom: 14px; }
.pool-rule-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.pool-rule-switch { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; cursor: pointer; }
.pool-check-list { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 4px; }
.pool-check-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.pool-holding-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pool-holding-table td { padding: 5px 8px; border-bottom: 1px solid var(--border-color, #f1f3f4); }
.pool-holding-num { text-align: right; font-variant-numeric: tabular-nums; }
.pool-holding-num.is-over { color: var(--danger, #c5221f); font-weight: 600; }

/* ===== 2.1.1.0 F6：公海扫描与回收 ===== */
.pool-scan-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border-color, #e8eaed); padding-bottom: 8px; }
.pool-scan-tab {
  padding: 5px 14px; font-size: 13px; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  color: var(--text-secondary, #5f6368);
}
.pool-scan-tab.is-active {
  background: rgba(26, 115, 232, .1); color: var(--primary, #1a73e8);
  border-color: rgba(26, 115, 232, .3); font-weight: 600;
}
.pool-scan-list { max-height: 340px; overflow-y: auto; }
.pool-scan-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.pool-scan-item:hover { background: var(--bg-secondary, #f8f9fa); }
.pool-scan-info { flex: 1; min-width: 0; }
.pool-scan-name { font-size: 13px; font-weight: 600; }
.pool-scan-meta { font-size: 12px; color: var(--text-secondary, #5f6368); margin-top: 2px; }

/* ===== 2.1.0.9 外观优化 A5：表格行高密度切换 ===== */
.customer-table.is-compact th { padding: 5px 8px; font-size: 12px; }
.customer-table.is-compact td { padding: 4px 8px; font-size: 12px; line-height: 1.45; }
.customer-table.is-compact .cust-tag-chip { font-size: 11px; padding: 1px 7px; }
.customer-table.is-compact .btn-link { font-size: 12px; }

/* ===== 2.1.0.9 外观优化 A4②：列表加载骨架屏 ===== */
.cust-skeleton-row td { padding: 11px 12px; }
.cust-skeleton-bar {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-secondary, #f1f3f4) 25%, rgba(255, 255, 255, .65) 37%, var(--bg-secondary, #f1f3f4) 63%);
  background-size: 400% 100%;
  animation: custSkeleton 1.4s ease infinite;
}
@keyframes custSkeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ===== 2.1.0.8 外观优化 A4：空状态引导 ===== */
.cust-empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; }
.cust-empty-icon { font-size: 28px; line-height: 1; opacity: .35; }
.cust-empty-title { font-size: 14px; font-weight: 600; color: var(--text-secondary, #5f6368); }
.cust-empty-hint { font-size: 12px; color: var(--text-tertiary, #9aa0a6); text-align: center; line-height: 1.6; }

/* ===== 2.1.0.7：新增组件的暗色适配 ===== */
[data-theme="dark"] .cust-timeline-item { border-left-color: var(--border); }
[data-theme="dark"] .cust-timeline-text { color: var(--text-primary); }
[data-theme="dark"] .cust-timeline-meta { color: var(--text-secondary); }
[data-theme="dark"] .cust-collab-value { color: var(--text-primary); }

/* ===== 2.1.0.5 外观优化 A2：标签 chip 悬停轻微阴影（设计稿要求） ===== */
.cust-tag-chip { transition: box-shadow .15s ease; }
.cust-tag-chip:hover { box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
[data-theme="dark"] .cust-tag-chip:hover { box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
/* 详情标签区块：独立白卡（与 .customer-detail-info 同风格；不能嵌入信息卡内部，因其内容由 JS innerHTML 渲染会覆盖） */
.cust-detail-tags-block,
.cust-detail-block {
  margin-top: 14px;
  background: var(--white, #fff);
  border: 1px solid var(--border, #e3e6ea);
  border-radius: 12px;
  padding: 14px 20px 16px;
}
.cust-detail-tags-title { font-size: 12px; color: var(--text-tertiary); margin-bottom: 8px; font-weight: 600; }
.cust-detail-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; min-height: 24px; }

/* ===== 2.1.0.1：客户联系人区块 ===== */
.cust-detail-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cust-detail-block-head .cust-detail-tags-title { margin-bottom: 0; }
.cust-contact-list { display: flex; flex-direction: column; gap: 8px; }
.cust-contact-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; background: #f8f9fa; border: 1px solid transparent; border-radius: 8px;
  transition: background .15s ease, border-color .15s ease;
}
.cust-contact-row:hover { background: #f1f3f4; }
.cust-contact-row.is-primary { background: #e8f0fe; border-color: #d2e3fc; }
.cust-contact-main { min-width: 0; flex: 1; }
.cust-contact-name { font-size: 13px; font-weight: 600; color: var(--text, #202124); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cust-contact-badge { font-size: 11px; font-weight: 600; color: var(--blue); background: #d2e3fc; padding: 1px 7px; border-radius: 9px; line-height: 1.5; }
.cust-contact-title { font-size: 12px; color: var(--text-tertiary, #9aa0a6); font-weight: 400; }
.cust-contact-sub { font-size: 12px; color: var(--text-secondary, #5f6368); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-contact-ops { display: flex; gap: 2px; flex: 0 0 auto; }
.cust-contact-primary-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary, #5f6368); cursor: pointer; margin-top: 4px; }

/* ===== 2.1.0.1：客户自定义扩展字段（客户表单内动态渲染） ===== */
.cust-extra-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.cust-extra-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cust-extra-label { font-size: 12px; color: var(--text-secondary, #5f6368); }
.cust-extra-input {
  width: 100%; padding: 7px 10px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--border, #e3e6ea); border-radius: 8px; background: var(--surface, #fff); color: var(--text, #202124);
}
.cust-extra-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26, 115, 232, .15); }
@media (max-width: 768px) { .cust-extra-fields { grid-template-columns: 1fr; } }

/* ===== 2.1.0.1：字段管理 → 自定义字段面板 ===== */
.cf-hint { font-size: 12px; line-height: 1.7; color: var(--text-secondary, #5f6368); background: #f8f9fa; border-left: 3px solid var(--blue); padding: 8px 12px; border-radius: 0 6px 6px 0; }
.cf-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.cf-add .user-filter { flex: 1 1 140px; min-width: 0; }
.cf-list { display: flex; flex-direction: column; gap: 6px; }
.cf-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #f8f9fa; border-radius: 8px; }
.cf-row.is-off { opacity: .55; }
.cf-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-label { font-size: 13px; font-weight: 600; color: var(--text, #202124); }
.cf-key { font-size: 11px; color: var(--text-tertiary, #9aa0a6); font-family: ui-monospace, Menlo, Consolas, monospace; background: #eef0f2; padding: 1px 6px; border-radius: 4px; }
.cf-type { font-size: 11px; color: var(--text-secondary, #5f6368); }
.cf-req { font-size: 11px; color: var(--state-danger, #c5221f); background: var(--state-danger-bg, #fce8e6); padding: 1px 6px; border-radius: 4px; }
.cf-off { font-size: 11px; color: #5f6368; background: #f1f3f4; padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--text-tertiary, #9aa0a6); }
.tag-manage-add { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.tag-color-input { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--border, #e3e6ea); border-radius: 8px; background: var(--surface, #fff); cursor: pointer; }
.tag-manage-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.tag-manage-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #f8f9fa; border-radius: 8px; }
.tag-manage-name { flex: 1; font-size: 13px; font-weight: 600; }
.tag-manage-count { font-size: 12px; color: var(--text-tertiary); }
.batch-tag-mode { display: flex; gap: 16px; margin-bottom: 12px; font-size: 13px; }
.tag-picker-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.tag-picker-item:hover { background: #f1f3f4; }
.tag-picker-item.checked { background: #e8f0fe; }
.modal-footer-right { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border, #e3e6ea); }

/* 响应式：< 900px 时左栏收起为顶部横向滚动 */
@media (max-width: 900px) {
  .cust-layout { grid-template-columns: 1fr; }
  /* 手机端左栏统一改为「纵向堆叠」：
     原先被做成横向滚动条（display:flex; flex-wrap:nowrap; overflow-x:auto），
     会把列表压成一条、需要左右滑动，是项目/客户/产品/专利/备忘录/历史等模块排版混乱的共同主因。
     现为：标题 → 筛选（恢复显示，避免空白）→ 列表纵向铺满。 */
  .cust-sidebar { position: static; max-height: none; display: block; overflow-x: visible; }
  /* 列表纵向铺满；条数多时限高内滚。
     ⚠ 必须 nowrap：纵向 flex 若加 flex-wrap:wrap，配合 max-height 会「换列」变成两列，
     曾导致项目/历史/产品/备忘录等各模块列表被劈成两列。 */
  .cust-nav { flex-direction: column; flex-wrap: nowrap; max-height: 52vh; overflow-y: auto; }
  .cust-nav-group { display: block; }
  /* 筛选下拉恢复显示：否则被全局 .user-filter{display:none!important} 隐藏，只剩一片空白 */
  .cust-sidebar .user-filter { display: block !important; }
  .cust-sidebar .pm-search { width: 100%; }
  /* 2.1.1.4：底部入口（管理标签 / 公海规则 / 公海扫描）在窄屏保留。
     原规则把整个 foot 隐藏，会导致这些功能入口在手机端彻底消失。 */
  .cust-sidebar-foot { display: flex; gap: 8px; flex-wrap: wrap; }
}

/* 列设置下拉 */
.col-chooser-wrap { position: relative; }
.col-chooser {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-panel);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-3);
  padding: 12px 14px;
  min-width: 188px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.col-chooser-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.col-chooser-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}

/* 客户列表页头「更多 ▾」动作菜单（2.1.4-beta8）
   复用 .col-chooser 的浮层定位 / 阴影 / 显隐协议（JS 用 display:grid 开关，与列设置一致），
   只把两列勾选布局改成竖排按钮列表。
   ⚠ 必须带 #customerView 前缀：.col-chooser 还被「标签筛选 ▾」「列设置 ▾」用着，
     裸改 grid-template-columns 会把那两处的两列勾选也压成一列。 */
#customerView .cust-more-actions {
  grid-template-columns: 1fr;
  padding: 6px;
  gap: 4px;
  width: max-content;
  min-width: 0;
}
#customerView .cust-more-actions > .btn-secondary {
  width: 100%;
  height: 32px;
  justify-content: center;
  white-space: nowrap;
}

/* 客户列表工具区：筛控件与按钮同高（2.1.4-beta8）
   .user-filter 基础 36px，.btn-secondary/.btn-primary 基础 40px —— 搜索框与按钮混在
   同一行时，按钮上下各高出 2px（垂直居中后看着"没对齐"），页头与筛选栏都有这个问题。
   只在这两个工具区收按钮到 36px；表单、弹窗、详情页里的按钮仍是 40px。
   字号与左右内边距保持 14px / 18px：一度压到 13px / 16px，1440 实测「新增跟进记录」
   文字贴边（6 个字几乎顶满按钮），同高不该拿舒展度换。
   ⚠ 用后代选择器（不带 >）：「更多 ▾」外面包着 .col-chooser-wrap，不是直接子元素，
     写 > .btn-secondary 会让它留在 40px、和旁边的 36px 继续错位。 */
#customerView .customer-top-actions .btn-secondary,
#customerView .customer-top-actions .btn-primary,
#customerView .customer-top-actions .btn-accent,
#customerView .customer-filter-bar .btn-secondary {
  height: 36px;
  padding: 0 18px;
  font-size: 14px;
}

/* 页头「新增跟进记录」改白底绿字描边（2.1.4-beta8）
   它原本是 btn-accent 绿填充，theme-pro 又把 btn-primary 也改成青绿渐变 ——
   两个绿底按钮并排、色相相近但不同，实测看着像配色事故。保留绿色语义、去掉填充，
   页头只留「新增客户」一个实心主操作。
   ⚠ 必须覆盖 hover：基础 .btn-accent:hover 是 opacity:.92，白底变半透明会发灰。 */
#customerView .customer-top-actions .btn-accent {
  background: var(--white);
  color: var(--green);
  border-color: var(--green);
}
#customerView .customer-top-actions .btn-accent:hover {
  opacity: 1;
  background: var(--state-success-bg, #e8f5e9);
  color: var(--green);
}

/* 修复：客户编辑弹窗改为整齐两列网格 */
#customerForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
#customerForm .form-field { width: auto; }
#customerForm .form-field-full { grid-column: 1 / -1; }
#customerForm .modal-footer { grid-column: 1 / -1; }
/* 2.1.3-beta11：原硬编码 600px 特例 → 改由 .modal-lg 承担，已在 index.html 给该弹窗加上
   modal-lg 类。⚠ .modal-lg 的宽度（640px）定义在文件后段「客户详情/跟进弹窗」区块（既有），
   此处不重复声明——同特异性下后段会覆盖前段，重复写只会变死代码。
   见 docs/UI优化待办.md #8。 */

/* 修复：客户详情弹窗区块竖向铺满，避免 flex-wrap 错位并排 */
#customerDetailOverlay .modal-body > * { width: 100%; flex-basis: 100%; }

/* 客户详情 — 状态变更记录（P2） */
.status-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.status-log-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  border-left: 3px solid var(--blue);
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}
.status-log-change {
  font-weight: 600;
  color: var(--text-primary);
}
.status-log-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 客户查重合并弹窗 */
.merge-tip {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 16px;
  line-height: 1.6;
}
.merge-tip strong { color: var(--text-primary); }
.merge-dim {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.merge-dim-label { font-weight: 600; color: var(--text-primary); }
.merge-dim-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}
.merge-dim-opt input { cursor: pointer; }
.merge-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.merge-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface, #fff);
}
.merge-group-title {
  font-size: 14px;
  margin-bottom: 10px;
}
.merge-group-count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 6px;
}
.merge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.merge-item:hover { background: var(--surface-2); }
.merge-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.merge-item-name {
  font-weight: 600;
  color: var(--text-primary);
}
.merge-item-status {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
}
.merge-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.merge-group-bar {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* 客户详情 / 跟进弹窗 */
.modal-lg {
  width: 640px;
}
.customer-detail-info {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}
.customer-detail-info h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--text);
}
/* 客户详情 — 关联工作记录 */
.related-entries {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.related-entry-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.related-entry-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.related-entry-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.related-entry-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
  white-space: pre-wrap;
}
.followup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.followup-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
}
.followup-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.followup-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}
.followup-del {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
}
.followup-add {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  margin-bottom: 16px;
}
.followup-add-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 10px;
}
.followup-add-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ===== 2.1.3：跟进附件（图片在左 / 文件在右，每类上限 3 个）===== */
.fu-att { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.fu-att-col { flex: 1 1 240px; min-width: 0; }
.fu-att-col + .fu-att-col { border-left: 1px solid var(--border); padding-left: 14px; }
.fu-att-head { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.fu-att-count { color: var(--text-tertiary); }
.fu-att-grid { display: flex; gap: 8px; flex-wrap: wrap; min-height: 54px; }
.fu-att-thumb-box { position: relative; width: 54px; height: 54px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.fu-att-thumb { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.fu-att-del { position: absolute; top: 0; right: 0; width: 16px; height: 16px; line-height: 14px; text-align: center; border: none; border-radius: 0 0 0 6px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; cursor: pointer; padding: 0; }
.fu-att-files { display: flex; flex-direction: column; gap: 6px; min-height: 54px; }
.fu-att-file-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.fu-att-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.fu-att-file-size { color: var(--text-tertiary); font-size: 12px; flex: 0 0 auto; }
.fu-att-file-row .fu-att-del { position: static; background: none; color: var(--red); width: auto; height: auto; border-radius: 0; }
.fu-att-empty { font-size: 12px; color: var(--text-tertiary); line-height: 54px; }
.fu-att-tools { display: flex; gap: 12px; margin-top: 6px; }
.fu-att-tools .btn-link:disabled { color: var(--text-tertiary); cursor: not-allowed; }

/* 只读展示：左图片缩略图 / 右文件链接（无内容的一侧不渲染） */
.fu-att-view { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-top: 8px; }
.fu-att-view-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.fu-att-view-imgs .fu-att-thumb { width: 64px; height: 64px; border-radius: 6px; border: 1px solid var(--border); }
.fu-att-view-files { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fu-att-file { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--link, #1a73e8); text-decoration: none; min-width: 0; }
.fu-att-file:hover { text-decoration: underline; }
.fu-att-file-ico { flex: 0 0 auto; }

/* 媒体库文件选择弹窗内的文件列表 */
.fu-pick-files { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.fu-pick-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.fu-pick-file:hover { background: var(--bg-hover, #f5f7fa); }
.fu-pick-file .fu-att-file-name { flex: 1 1 auto; }

/* 客户 360 时间线内的附件 */
.cust-timeline-att { margin-top: 6px; }
.cust-timeline-att .fu-att-view { margin-top: 0; }

/* 时间线内的跟进操作（编辑/删除）。
   不直接复用 .followup-actions：那条规则是 justify-content:flex-end（明细列表右对齐），
   在时间线条目里会被顶到最右，与左侧竖线错位。 */
.cust-timeline-actions { display: flex; gap: 10px; margin-top: 8px; }
.cust-timeline-act {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-secondary); font-size: 12px; padding: 2px 10px; cursor: pointer;
}
.cust-timeline-act:hover { border-color: var(--blue, #1a73e8); color: var(--blue, #1a73e8); }
.cust-timeline-act.is-danger:hover { border-color: var(--error, #d93025); color: var(--error, #d93025); }
/* 编辑态：隐藏时间线的竖线与圆点，否则编辑表单左侧会留半截线 */
.cust-timeline-item.is-editing { padding-left: 0; border-left: none; }
.cust-timeline-item.is-editing::before { display: none; }

/* 图片大图查看（点击缩略图） */
.img-viewer-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); z-index: 4000; display: none; align-items: center; justify-content: center; }
.img-viewer-mask img { max-width: 92vw; max-height: 92vh; border-radius: 6px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5); }

/* 窄屏：图片/文件两栏改为上下堆叠，避免挤压 */
@media (max-width: 640px) {
  .fu-att { flex-direction: column; }
  .fu-att-col + .fu-att-col { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 10px; }
  .fu-att-view { flex-direction: column; }
}

/* 客户详情 — 跟进记录：操作行与内联编辑 */
.followup-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}
.followup-actions .followup-del {
  position: static;
  top: auto;
  right: auto;
  font-size: 13px;
}
.followup-edit {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 2px 10px;
  cursor: pointer;
}
.followup-edit:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.followup-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 分类类型 */
.cat-mgmt-type-select {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--white);
  font-size: 14px;
  color: var(--text-primary);
}
.cat-mgmt-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-secondary);
}
.cat-mgmt-edit-type {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 6px;
  background: var(--white);
  font-size: 13px;
}

/* ============================================================
   2.0.4.0 新增样式：手机端导航 / 流量统计 / 登录日志 / 底部导航配置
   ============================================================ */

/* ---- 手机端顶栏与底部导航（默认隐藏，≤768px 才显示）---- */
.mobile-topbar { display: none; }
.mobile-bottom-nav { display: none; }
.mobile-more-mask { display: none; }
.mobile-more-sheet { display: none; }
/* 手机端周导航：桌面用顶栏 #dateNav，此条仅在窄屏块里打开 */
.mobile-datenav { display: none; }

/* ---- 底部导航默认集 / 个人覆盖 复选框 ---- */
.bnav-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 4px 0 14px;
}
.bnav-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}
.bnav-check input { width: 16px; height: 16px; cursor: pointer; }
/* ---- 客户状态机矩阵（S3）---- */
.status-machine-matrix { margin-top: 6px; }
.sm-matrix-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 5px 0; border-bottom: 1px dashed var(--border, #eee); }
.sm-matrix-row:last-child { border-bottom: none; }
.sm-matrix-from { font-weight: 600; min-width: 72px; color: var(--text-secondary, #444); }
.sm-matrix-cell { margin: 0; font-size: 12px; }
.personal-sep { margin: 22px 0 14px; border: none; border-top: 1px solid var(--border); }
/* ---- 产品模块 + 规格书（v2.1.1.10）---- */
/* 双栏与客户模块同一套栅格（240px 左栏 + 自适应右栏），窄屏折叠为单列 */
.product-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.product-layout > .cust-sidebar { min-width: 0; width: 100%; }
/* 列表项：编号 + 名称同行，超长截断不撑破容器 */
.product-layout .cust-nav-item { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 详情头部：标题信息与操作区对齐，窄屏自动换行 */
.product-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.product-head .product-name { margin-bottom: 0; }
.product-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.product-name { font-size: 18px; margin-bottom: 2px; }
.product-name small { color: #888; font-weight: normal; }
.product-meta { color: #666; font-size: 13px; margin-top: 4px; }
/* 产品主图（v2.1.1.10 二期：每个产品最多 1 张，用于区分型号） */
.product-image { margin: 10px 0; }
.product-image img { max-width: 260px; max-height: 200px; border: 1px solid var(--border, #eee); border-radius: 8px; background: var(--surface, #fff); object-fit: contain; display: block; }
.product-img-pick { margin-top: 6px; min-height: 84px; display: flex; align-items: center; justify-content: center; border: 1px dashed #dadce0; border-radius: 8px; background: #fafbfc; padding: 6px; }
.product-img-pick img { max-width: 160px; max-height: 120px; object-fit: contain; display: block; }
.product-img-empty { color: #9aa0a6; font-size: 12px; }
.spec-builder-bar { margin: 8px 0 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spec-builder-bar select.user-filter { min-width: 160px; }
.spec-builder-bar .btn-sm { white-space: nowrap; }
@media (max-width: 900px) {
  .product-layout { grid-template-columns: 1fr; }
  .product-layout > .cust-sidebar { position: static; max-height: none; }
}
.spec-canvas { display: flex; flex-direction: column; gap: 12px; }
.spec-inst { border: 1px solid var(--border, #eee); border-radius: 8px; padding: 10px 12px; background: var(--surface, #fff); }
.spec-inst-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.spec-inst-ops button { border: none; background: none; cursor: pointer; color: #2563eb; font-size: 13px; }
.spec-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 13px; }
.spec-field > span { color: #555; }
/* 2.1.1.13：每行参数可上下移动/移除/在当前行下方添加新参数 */
.spec-field-row { display: flex; align-items: flex-start; gap: 8px; }
.spec-field-row .spec-field { flex: 1; margin-bottom: 0; }
.spec-field-ops { display: flex; gap: 4px; flex-wrap: nowrap; white-space: nowrap; padding-top: 18px; }
.spec-fields { width: 100%; border-collapse: collapse; }
.spec-fields th, .spec-fields td { border: 1px solid #ddd; padding: 6px 10px; text-align: left; font-size: 14px; vertical-align: top; }
.spec-fields th { width: 38%; background: #f7f9fc; font-weight: 600; }
.spec-module { margin-bottom: 18px; }
.spec-title { font-size: 22px; text-align: center; margin-bottom: 16px; }
/* 规格书封面产品图（随打印/导出 PDF 一并输出） */
/* 2.1.1.13：导出/打印时产品图不宜过大，确保常规参数表尽量落在一张 A4 内 */
.spec-cover-img { text-align: center; margin-bottom: 10px; page-break-inside: avoid; }
.spec-cover-img img { max-width: 220px; max-height: 140px; object-fit: contain; }
.cust-nav-item.active { background: #e8f0fe; color: var(--blue); font-weight: 600; }
@media print {
  body * { visibility: hidden; }
  #specPrintArea, #specPrintArea * { visibility: visible; }
  #specPrintArea { position: absolute; left: 0; top: 0; width: 100%; padding: 24px; }
  .no-print { display: none !important; }
}
/* ---- 编辑弹窗字段排版（v2.1.1.10：块级字段 + 标签在上 + 按钮右对齐）---- */
.pe-field { display: block; margin-bottom: 12px; }
.pe-label { font-size: 13px; color: #5f6368; margin-bottom: 4px; }
.pe-field .user-filter { width: 100%; }
.pe-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
/* 产品页标题条：Tab + 操作按钮紧凑对齐 */
#productView .section-header { margin: 0 0 12px; align-items: center; gap: 12px; }
.product-tabs { display: flex; align-items: center; gap: 4px; }
.product-tab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 10px 12px; font-size: 16px; font-weight: 600; color: #5f6368; cursor: pointer; line-height: 1.2;
}
.product-tab:hover { color: var(--blue); }
.product-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.product-top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.product-top-actions > .btn-secondary { display: inline-flex; align-items: center; height: 32px; }
/* 规格书模版页：复用 product-layout 栅格，左栏列表随侧边栏滚动 */
.spec-template-layout { align-items: stretch !important; }
.spec-template-layout > .cust-sidebar { display: flex; flex-direction: column; }
@media (max-width: 900px) {
  #productView .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .product-top-actions { width: 100%; justify-content: flex-start; }
  .spec-template-layout { grid-template-columns: 1fr; }
  .spec-template-layout > .cust-sidebar { position: static; max-height: none; }
}

/* ---- 媒体库（v2.1.1.10）---- */
.ml-item.active { background: #e8f0fe; border-radius: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-card { border: 1px solid #e8eaed; border-radius: 8px; overflow: hidden; background: var(--surface, #fff); display: flex; flex-direction: column; }
.media-thumb { width: 100%; height: 120px; background: #f6f8fa; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.media-name { font-size: 13px; padding: 6px 8px 2px; color: #202124; word-break: break-all; }
.media-meta { font-size: 12px; color: #80868b; padding: 0 8px 4px; }
.media-ops { padding: 4px 8px 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.media-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.media-table th, .media-table td { border-bottom: 1px solid #e8eaed; padding: 8px 10px; text-align: left; }
.media-table th { background: #f6f8fa; color: #5f6368; font-weight: 600; }
.media-table td { color: #202124; }
/* 图片选择器（复用媒体库已有图片，供产品主图等引用） */
.media-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-pick-item { border: 1px solid #e8eaed; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface, #fff); }
.media-pick-item:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(26,115,232,.2); }
.media-pick-item img { width: 100%; height: 100px; object-fit: contain; background: #f6f8fa; display: block; }
.media-pick-name { font-size: 12px; color: #5f6368; padding: 4px 6px; word-break: break-all; }

/* ---- 模块库管理模态框（v2.1.1.10）---- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: var(--z-modal); }
.modal-box { background: var(--surface, #fff); border-radius: 10px; width: 92%; max-width: 560px; max-height: 86vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border, #eee); }
.modal-x { border: none; background: none; font-size: 20px; cursor: pointer; line-height: 1; }
.modal-body { padding: 14px 16px; }
.ml-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed #eee; }

/* ---- 流量统计 ---- */
.traffic-today {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.traffic-stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: center;
}
.tsc-val { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.tsc-title { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.tsc-sub { font-size: 11px; color: var(--green); margin-left: 4px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
/* 2.1.3-beta39：视图的**第一个**标题不要再叠 14px 上边距 —— 内容区顶部已收窄到 8px，
   再叠 14px 就是用户反复圈的那条空带（出货规则书 / 模具 / 媒体库 / 共享文件夹 / 周报）。
   只命中「视图容器直接子元素且排第一」的标题；统计分析等连排小节标题、卡片内标题不受影响。
   ⚠ 上面的 margin: 14px 0 8px 是给连排小节留的间隔，删了会挤。 */
[id$="View"] > .section-header:first-child { margin-top: 0; }
.traffic-range-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.traffic-range-btn {
  height: 32px; padding: 0 14px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--white);
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  transition: all 0.15s var(--ease);
}
.traffic-range-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 柱状图（复用纯 CSS 风格） */
.traffic-trend, .traffic-hours {
  display: flex; align-items: flex-end; gap: 4px;
  height: 150px; padding: 10px; overflow-x: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
}
.traffic-hours { height: 120px; }
.bar-col {
  flex: 1 0 auto; min-width: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%;
}
.bar-val { font-size: 10px; color: var(--text-tertiary); margin-bottom: 2px; }
.bar-track { width: 70%; flex: 1; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.3s var(--ease); }
.bar-label { font-size: 10px; color: var(--text-tertiary); margin-top: 4px; white-space: nowrap; }

/* 来源分析占比条 */
.traffic-sources { display: flex; flex-direction: column; gap: 10px; }
.src-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.src-label { width: 80px; color: var(--text-primary); flex-shrink: 0; }
.src-track { flex: 1; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; border: 1px solid var(--border); }
.src-fill { display: block; height: 100%; background: var(--green); border-radius: 5px; }
.src-val { width: 110px; text-align: right; color: var(--text-secondary); flex-shrink: 0; }

/* 受访 TOP10 */
.toppage-row { display: grid; grid-template-columns: 1fr 70px 70px 60px; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.toppage-row span { text-align: right; color: var(--text-secondary); }
.toppage-row .tp-path { text-align: left; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toppage-head { font-weight: 600; color: var(--text-secondary); background: var(--bg); }

/* 实时访客 */
.traffic-recent { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; overflow-x: auto; }
.recent-row { display: grid; grid-template-columns: 90px 90px 1fr 120px; gap: 8px; padding: 6px 8px; font-size: 12px; border-bottom: 1px solid var(--border); align-items: center; }
.recent-row .rc-time { color: var(--text-tertiary); }
.recent-row .rc-user { color: var(--blue); font-weight: 600; }
.recent-row .rc-path { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row .rc-ip { color: var(--text-tertiary); text-align: right; }
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}
/* 空态图标占位：淡灰圆 + 内描边，替代「死板纯文字」 */
.empty::before {
  content: '';
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--border);
}
/* 空态引导按钮（HTML 中可选使用 .empty-action） */
.empty-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 7px 16px;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--white);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.empty-action:hover {
  background: var(--blue-dark);
}

/* 10. 实时在线卡片 */
.traffic-online-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--blue-light), var(--blue-light));
  border: 1px solid var(--blue-light); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
}
.to-cnt { display: flex; flex-direction: column; align-items: center; min-width: 76px; }
.to-cnt span { font-size: 30px; font-weight: 700; color: var(--blue, var(--blue)); line-height: 1.1; }
.to-cnt small { font-size: 12px; color: var(--text-secondary); }
.to-users { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 200px; }
.to-user { font-size: 12px; padding: 3px 8px; background: rgba(26,115,232,.1); color: var(--blue, var(--blue)); border-radius: 12px; }
.to-user.to-empty { background: transparent; color: var(--text-tertiary); }
.to-tip { width: 100%; font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ===== 手机端「访问统计」紧凑排版 =====
   原：4 张统计卡用 minmax(150px,1fr)，窄屏只排得下 1 列 → 一行一张、又高又空（"太散"）。
   改为 2 列小卡，并收紧在线卡 / 图表 / 列表，提升信息密度、一屏可见更多。 */
@media (max-width: 768px) {
  .traffic-today { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .traffic-stat-card { padding: 10px 8px; border-radius: 10px; }
  .tsc-val { font-size: 20px; }
  .tsc-title { font-size: 12px; margin-top: 2px; }
  .tsc-sub { font-size: 10px; }
  /* 实时在线卡：收紧留白 */
  .traffic-online-card { gap: 10px; padding: 10px 12px; margin-bottom: 10px; }
  .to-cnt { min-width: 56px; }
  .to-cnt span { font-size: 22px; }
  .to-cnt small { font-size: 11px; }
  .to-tip { font-size: 10px; }
  /* 图表降低高度，减少空白 */
  .traffic-trend { height: 120px; }
  .traffic-hours { height: 96px; }
  /* 受访 TOP10 / 实时访客：收窄列宽，避免容器内部横向滚动 */
  .toppage-row { grid-template-columns: minmax(0, 1fr) 46px 46px 40px; gap: 4px; padding: 8px 6px; font-size: 12px; }
  .recent-row { grid-template-columns: 56px 56px minmax(0, 1fr) 84px; gap: 6px; font-size: 11px; }
}

/* ---- 登录日志 ---- */
.loginlog-subtabs { display: flex; gap: 8px; margin-bottom: 12px; }
.loginlog-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.loginlog-filter .user-filter { height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-primary); background: var(--white); }
.loginlog-list { display: flex; flex-direction: column; gap: 4px; overflow-x: auto; }
.ll-row { display: grid; grid-template-columns: 90px 110px 90px 130px 1fr; gap: 8px; padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--border); align-items: center; }
.ll-row .ll-time { color: var(--text-tertiary); }
.ll-row .ll-user { color: var(--blue); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-row .ll-act { font-weight: 600; }
.ll-row .ll-ip { color: var(--text-tertiary); text-align: right; }
.ll-row .ll-detail { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loginlog-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.pager-info { font-size: 13px; color: var(--text-secondary); }

/* ============================================================
   2.0.4.0 响应式：手机端（≤768px）底部导航 + 抽屉侧边栏 + 适配
   ============================================================ */
@media (max-width: 768px) {
  /* 显示手机端顶栏与底部导航：☰ 与"工作OA"同一行（左对齐） */
  .mobile-topbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    height: 52px;
    padding: 0 14px;
    padding-top: env(safe-area-inset-top);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-panel);
  }
  .mobile-hamburger {
    width: 40px; height: 40px; border: none; background: none;
    color: var(--text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px;
  }
  .mobile-hamburger:active { background: var(--bg); }
  .mobile-topbar-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }

  /* 侧边栏改为抽屉（默认隐藏，汉堡点开） */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 220px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: var(--z-dropdown);
    box-shadow: 2px 0 12px rgba(0,0,0,0.12);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-logo { display: flex; }

  /* 内容区给固定顶栏(52px)与底部导航(64px)让位（.main 在 HTML 中不存在，改为 .content-area） */
  #app { padding-top: 0; }
  .content-area {
    padding: 14px;
    /* 补 env(safe-area-inset-top/bottom)：mobile-topbar 与 mobile-bottom-nav 自身带这两个
       内边距，刘海屏上顶栏实际高于 52px、底栏高于 56px，这里不补就会压住内容一截。 */
    padding-top: calc(52px + 14px + env(safe-area-inset-top));
    padding-bottom: calc(64px + 14px + env(safe-area-inset-bottom));
  }

  /* 本周工作：手机端每天卡片独占一行（避免7天被压成极窄列） */
  .week-row { flex-direction: column; }
  .day-card { flex: none; width: 100%; }

  /* 内容区 section 头部：窄屏下标题独占一行，操作/筛选按钮换行到下方（避免标题与内容左右并排） */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .section-header > button,
  .section-header > .section-meta,
  .section-header > .project-list-actions,
  .section-header > .customer-top-actions,
  .section-header > .history-filter { width: 100%; }

  /* 底部导航固定显示 */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    z-index: var(--z-header);
  }
  .mbn-btn {
    flex: 1;
    border: none; background: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; cursor: pointer; color: var(--text-tertiary);
    font-size: 11px; padding: 4px 2px; min-height: 44px;
  }
  .mbn-btn.active, .mbn-btn.mbn-more { color: var(--blue); }
  .mbn-icon { font-size: 20px; line-height: 1; }
  .mbn-label { font-size: 11px; }

  /* 「更多」底部弹出面板 */
  .mobile-more-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: var(--z-float);
  }
  .mobile-more-sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--white);
    border-radius: 16px 16px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    z-index: var(--z-topbar);
    max-height: 70vh; overflow-y: auto;
    animation: sheetUp 0.2s ease;
  }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .mobile-more-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 14px; font-size: 15px; font-weight: 600; color: var(--text-primary); }
  .mobile-more-close { border: none; background: none; font-size: 18px; color: var(--text-tertiary); cursor: pointer; }
  .mobile-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .mm-item {
    border: 1px solid var(--border); background: var(--white);
    border-radius: 12px; padding: 16px 8px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; color: var(--text-primary); font-size: 13px; min-height: 44px;
  }
  .mm-item:active { background: var(--bg); }
  .mm-icon { font-size: 22px; }

  /* 手机端隐藏桌面顶栏（.toolbar），避免与 .mobile-topbar 双层叠加 */
  .toolbar { display: none !important; }

  /* 桌面端隐藏的元素在手机端按需显示 */
  .fab { bottom: 72px; }

  /* 抽屉/更多弹层打开时隐藏 FAB，避免遮挡弹层 */
  body.sidebar-open .fab,
  body.more-open .fab { display: none !important; }

  /* 设置页窄屏回退已统一移至独立 @media (max-width: 1024px) 块，此处不再重复 */

  /* 职位管理：手机端回退为上下结构（保留于 900px 块以防 1024px 块失效时的兜底） */
  .position-layout { flex-direction: column; gap: 16px; }
  .position-list-col { flex: none; width: 100%; }
  .position-form-col { flex: none; width: 100%; }
  .position-row { cursor: default; }

  /* ===== 移动端独有规则（此前因括号错位逃逸为全局，现已归位） ===== */
  .sidebar.mobile-open .nav-label,
  .sidebar.mobile-open .nav-item span,
  .sidebar.mobile-open .profile-info,
  .sidebar.mobile-open .logo-text,
  .sidebar.mobile-open .profile-chevron { display: block; }
  .sidebar.mobile-open .nav-item { justify-content: flex-start; padding: 10px 14px; }
  .sidebar.mobile-open .profile-section { justify-content: flex-start; padding: 10px 14px; }

  /* 7. 抽屉遮罩：点遮罩关闭抽屉 */
  .sidebar-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.35);
    z-index: var(--z-header); display: none;
  }
  body.sidebar-open .sidebar-mask { display: block; }

  /* 筛选器手机端换行适配 */
  .loginlog-filter { flex-wrap: wrap; }
  .loginlog-filter .user-filter { flex: 1 1 120px; min-width: 110px; }

  /* 表格/卡片：手机端避免横向溢出，关键字段堆叠 */
  .customer-table-scroll, .entry-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 用户列表：手机端改为「两排」显示，不再依赖横向滚动
     第一排：头像 + 姓名/账号 + 部门 + 职位；第二排：操作按钮（整行右对齐）。
     表头因列已重排不再对应，故隐藏。 */
  .user-table { overflow-x: visible; }
  .user-table-header { display: none; }
  .user-row { min-width: 0; flex-wrap: wrap; column-gap: 10px; row-gap: 8px; padding: 10px 0; }
  .user-row-info { flex: 1 1 auto; min-width: 0; }
  .user-row-dept { width: auto; flex: 0 1 auto; max-width: 34%; }
  .user-row-role-cell { width: auto; flex: 0 0 auto; }
  .user-row-actions { width: auto; flex: 0 0 100%; justify-content: flex-end; }
  .modal-content { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .modal-body { max-height: none; }
  .modal-actions { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .search-box { width: 100%; }
  .action-row { flex-wrap: wrap; }

  /* 客户详情视图：手机端 sidebar 变为 52px 图标栏，内容从 sidebar 右侧开始 */
  #customerDetailView.detail-view {
    left: 52px;
    width: calc(100% - 52px);
    top: calc(52px + env(safe-area-inset-top));
    bottom: 0;
    z-index: var(--z-sticky-2);
  }
}

/* ===== 设置页窄屏适配（≤1024px，含平板竖屏）：左右结构回退为顶部横滑 Tab ===== */
@media (max-width: 1024px) {
  .settings-view {
    flex-direction: column;
    gap: 12px;
  }
  .settings-tabs {
    flex: none;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    width: 100%;
    position: static;
    align-self: auto;
    padding: 4px 14px 8px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    background: var(--white);
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-tabs-title { display: none; }
  #settingsTabs {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    width: 100%;
  }
  #settingsTabs::-webkit-scrollbar { display: none; }
  .settings-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 10px 16px;
    white-space: nowrap;
  }
  .settings-tab.active {
    background: transparent;
    border-left: none;
    border-bottom-color: var(--blue);
  }
  .position-layout { flex-direction: column; gap: 16px; }
  .position-list-col { flex: none; width: 100%; }
  .position-form-col { flex: none; width: 100%; }
  .position-row { cursor: default; }
}

/* 平板/小屏：保持侧边栏，不显示手机端导航（与 max-width:900px 对齐边界为 901px） */
@media (min-width: 901px) {
  .mobile-topbar, .mobile-bottom-nav, .mobile-more-mask, .mobile-more-sheet { display: none !important; }
}

/* ===== Week View 顶部布局：左统计区 + 右通知侧栏 ===== */
.week-top {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.stats-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* 通知侧栏 */
.notice-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  max-height: 190px;
}
.notice-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.notice-panel-header h3 {
  font-size: 14px;
  margin: 0;
}
.notice-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.notice-item {
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.notice-item:last-child { border-bottom: none; }
.notice-item.unread .notice-title { font-weight: 600; }
.notice-title {
  font-size: 12px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
}
.notice-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
/* 侧栏只显示标题，不显示正文预览（详情在模态框中查看） */
.notice-body {
  display: none;
}
.notice-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.notice-priority-urgent { color: var(--red); }
.notice-priority-important { color: var(--orange); }
.notice-detail-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.notice-detail-content {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.notice-more {
  margin-top: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.notice-more:hover { background: var(--hover); }
/* 未完成卡片警示色已统一至统计卡区块的 .stat-value-orange / .stat-value-red（改用 CSS 变量） */

/* 通知侧栏「发布」按钮：+ 图标 + 文字，轻量幽灵样式 */
.notice-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--primary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.notice-publish-btn:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.notice-publish-btn svg { display: block; }

/* 窄屏：通知侧栏收到统计区下方，占满宽度 */
@media (max-width: 768px) {
  .week-top { flex-direction: column; }
  .notice-panel { width: 100%; max-height: 320px; }
}

/* ==================== 备忘录模块 (2.0.4.27) ==================== */

.memo-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 12px 32px 12px 12px;
  min-height: 88px;
  min-width: 0; /* grid 项默认 min-width:auto，长内容会撑破固定列数 */
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
  overflow: hidden; /* 防止首次渲染时外部 DOM 溢入卡片内部 */
}
.memo-card:hover { box-shadow: var(--shadow-2); border-color: var(--blue); transform: translateY(-2px); }
.memo-card-overdue { border-color: var(--red); background: var(--red-light); }
.memo-card-today { border-color: var(--yellow); }
.memo-card-cat {
  align-self: flex-start;
  max-width: 100%;
  font-size: 11px;
  color: #fff;
  background: var(--text-tertiary);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.memo-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.memo-card-remind {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.memo-card-overdue .memo-card-remind { color: var(--red); font-weight: 600; }
.memo-card-done {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--green);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.memo-card-done { transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease); }
.memo-card-done:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* ===== 备忘录页 ===== */
.memo-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.memo-toolbar .user-filter { width: auto; min-width: 110px; }
.memo-toolbar input.user-filter { min-width: 160px; }
.memo-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.memo-empty {
  grid-column: 1 / -1; /* 跨所有列 */
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  background: var(--white);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.memo-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* grid 子项防长内容撑破列宽 */
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease), background .18s var(--ease);
}
.memo-item:hover {
  box-shadow: var(--shadow-2);
  border-color: var(--blue);
  transform: translateY(-2px);
  background: var(--surface-2);
}
.memo-item-pinned { border-left: 3px solid var(--blue); }
.memo-item-overdue { border-left: 3px solid var(--red); }
.memo-item-today { border-left: 3px solid var(--yellow); }
.memo-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.memo-pin,
.memo-cat {
  font-size: 11px;
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  background: var(--cat-bg, var(--blue-light));
  color: var(--cat-text, var(--blue));
  white-space: nowrap;
}
[data-theme="dark"] .memo-cat {
  background: color-mix(in srgb, var(--cat-bg) 40%, #2A2B32) !important;
  color: var(--text-primary) !important;
}
.memo-item-title {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  overflow-wrap: anywhere;
}
.memo-item-content {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 4.8em; /* 约 3 行，超出隐藏 */
  overflow: hidden;
}
.memo-item-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.memo-remind { color: var(--text-secondary); }
/* 2.0.4.28 回收站：删除时间与剩余天数 */
.memo-deleted-at { color: var(--text-tertiary); }
/* 回收站顶部说明条：跨满所有列 */
.memo-trash-tip {
  grid-column: 1 / -1;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
}
.memo-remind.overdue { color: var(--red); font-weight: 600; }
.memo-remind.today { color: var(--warn-text); font-weight: 600; }
.memo-repeat,
.memo-home-tag {
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 8px;
}
.memo-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.memo-item-actions .btn-primary,
.memo-item-actions .btn-secondary,
.memo-item-actions .btn-danger { padding: 5px 12px; font-size: 13px; }

/* ===== 字段选项：预设色板 + 自定义取色 (2.0.4.29) ===== */
.fo-color-palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.fo-color-swatch {
  height: 26px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.fo-color-swatch:hover { transform: scale(1.08); }
.fo-color-swatch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* 选中态：蓝色描边 + 外发光，与任何预设色都能明显区分 */
.fo-color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--blue), inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.fo-color-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fo-color-custom-txt {
  font-size: 12px;
  color: var(--text-tertiary);
}
/* 窄屏：色板降为 4 列，保证色块点击区域足够大（不小于 36px 触控目标） */
@media (max-width: 768px) {
  .fo-color-palette { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .fo-color-swatch { height: 36px; }
}

/* ===== 表单复选框行 ===== */
.memo-form-checks { display: flex; gap: 18px; flex-wrap: wrap; }
.memo-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ===== 首页卡片管理弹窗列表 ===== */
.memo-manage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}
.memo-manage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}
.memo-manage-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.memo-manage-move {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.memo-manage-move:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.memo-manage-move:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 响应式：备忘列表逐级降列 ===== */
@media (max-width: 1200px) {
  .memo-list { grid-template-columns: repeat(2, 1fr); }
}
/* 手机：卡片 2 列 + 列表单列；压缩卡片高度避免占屏过多 */
@media (max-width: 768px) {
  .memo-list { grid-template-columns: 1fr; }
  .memo-card { min-height: 0; padding: 10px 28px 10px 10px; gap: 4px; }
  .memo-card-title { font-size: 13px; -webkit-line-clamp: 2; }
  .memo-card-remind { font-size: 11px; }
  .memo-card-done { top: 6px; right: 6px; width: 20px; height: 20px; }
  .memo-toolbar { width: 100%; }
  .memo-toolbar .user-filter,
  .memo-toolbar input.user-filter { flex: 1; min-width: 0; }
}
/* ============================================================
   2.0.5.0 周报（规则汇总 + 复制 / Word / PDF 导出）
   ============================================================ */
.report-view { display: flex; flex-direction: column; gap: 16px; }

/* 工具条（不参与打印） */
.report-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.report-range { display: flex; align-items: center; gap: 8px; }
.report-range-text {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary, #202124); min-width: 220px;
}
.report-today-btn { padding: 6px 12px; font-size: 13px; }
/* 2.0.4.36：历史周报下拉 */
.report-history-select {
  padding: 6px 8px; font-size: 13px; max-width: 200px;
  border: 1px solid var(--border, #e0e0e0); border-radius: 6px;
  background: var(--surface, #fff); color: var(--text-primary, #202124);
}
.report-history-select:focus { outline: none; border-color: var(--blue, #1a73e8); }
.report-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 周报正文（打印 / 导出内容源） */
.report-paper {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px; padding: 22px 26px;
  color: #202124; line-height: 1.7;
}
.rp-head {
  text-align: center; padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 2px solid var(--blue, #1a73e8);
}
.rp-title { font-size: 21px; font-weight: 700; margin: 0 0 5px; letter-spacing: 2px; }
.rp-meta { font-size: 13px; color: #5f6368; }

.rp-section { margin-bottom: 18px; }
/* 首个章节（数据概览）与头部之间增加间距，确保标题不被视觉吞没 */
.rp-section:first-of-type { margin-top: 8px; }
.rp-sec-title {
  font-size: 15px; font-weight: 600; margin: 0 0 10px;
  color: var(--blue, #1a73e8);
}

/* 数据概览 KPI —— 限宽避免 5 个卡片平分整行显得松散 */
.rp-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-kpi {
  flex: 1 1 84px; max-width: 128px; min-width: 84px;
  display: flex; flex-direction: column;
  align-items: center; padding: 10px 6px;
  background: #f8f9fa; border-radius: 8px;
}
.rp-kpi-v { font-size: 18px; font-weight: 700; color: var(--blue, #1a73e8); line-height: 1.3; }
.rp-kpi-l { font-size: 11px; color: #5f6368; margin-top: 2px; }

/* 事项列表 */
.rp-list { margin: 0; padding-left: 22px; }
.rp-list li { margin: 6px 0; }
.rp-item-t { margin-right: 6px; }
.rp-tag {
  display: inline-block; font-size: 11px; color: var(--blue, #1a73e8);
  background: #e8f0fe; border-radius: 4px; padding: 1px 6px; vertical-align: middle;
}
.rp-empty { color: #9aa0a6; font-size: 13px; margin: 4px 0; }

/* 下周计划：屏幕上用编辑框，打印时换成预览文本 */
.rp-plan-input {
  width: 100%; box-sizing: border-box; font: inherit; line-height: 1.7;
  padding: 10px 12px; border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px; background: #fafafa; resize: vertical;
}
.rp-plan-input:focus { outline: none; border-color: var(--blue, #1a73e8); background: var(--surface, #fff); }

/* ===== 2.1.1.39 备忘录 / 历史记录 左右双栏 + 内联编辑（取消弹窗） ===== */
/* 左栏列表条目（复用 cust-nav-item + pm-nav-item 两行式；此处只补差异） */
.memo-nav-sub,
.history-nav-sub {
  display: block; font-size: 11px; color: var(--text-tertiary, #9aa0a6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px;
}
.history-nav-time {
  flex: 0 0 auto; font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--text-tertiary, #9aa0a6); width: 36px;
}
.pm-nav-item .pm-nav-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pm-nav-item .pm-nav-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* ===== 历史记录列表行排版优化 =====
   主行标题完整换行显示（不再单行省略截断）；状态徽标与「编辑」按钮下移到次行右侧，
   避免徽标压住标题，并给列表行提供直接编辑入口。 */
/* 历史记录：标题固定单行显示，超出以省略号截断（不跨行） */
.history-layout .pm-nav-item .pm-nav-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35;
}
.history-layout .history-nav-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  white-space: normal; overflow: visible; text-overflow: clip;
}
.history-nav-sub-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-nav-actions { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }
.pm-nav-edit {
  flex: 0 0 auto; font-size: 12px; line-height: 1.7; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border, #e3e6ea); background: var(--surface, #fff);
  color: var(--blue, #1a73e8); cursor: pointer; white-space: nowrap;
}
.pm-nav-edit:hover { background: var(--blue-light, #e8f0fe); }
/* 列表条目内的小徽标（置顶/逾期/今日/完成态） */
.nav-mini-badge {
  font-size: 10px; line-height: 1.4; border-radius: 8px; padding: 0 6px;
  background: var(--blue-light, #e8f0fe); color: var(--blue, #1a73e8); flex: 0 0 auto;
}
.nav-mini-badge.danger { background: var(--state-danger-bg, #fce8e6); color: var(--state-danger, #c5221f); }
.nav-mini-badge.warn { background: var(--state-warn-bg, #fef7e0); color: var(--state-warn, #b06000); }
.nav-mini-badge.ok { background: var(--state-ok-bg, #e6f4ea); color: var(--state-ok, #137333); }
/* 回收站提示条（侧栏内） */
.memo-trash-tip-inline {
  font-size: 12px; color: var(--state-warn, #b06000); background: var(--state-warn-bg, #fef7e0);
  border: 1px solid var(--warn-border, #fde293); border-radius: 8px; padding: 6px 10px; margin: 8px 4px;
}
/* 右栏详情卡内部 */
.memo-detail-content,
.history-detail-content {
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 13px;
  color: var(--text-secondary, #5f6368); background: var(--surface-2, #f8f9fa);
  border: 1px solid var(--border, #e3e6ea); border-radius: 8px; padding: 10px 12px; margin-top: 10px;
}
.history-detail-title { font-size: 16px; font-weight: 600; color: var(--text-primary, #202124); overflow-wrap: anywhere; }
.history-detail-title.is-done { text-decoration: line-through; color: var(--text-tertiary, #9aa0a6); }
/* 内联编辑宿主：把原 .modal 表单嵌入右栏（去掉弹窗定位外观，保留表单内部样式） */
.inline-modal-host .modal {
  width: 100%; max-width: none; max-height: none;
  transform: none; transition: none; box-shadow: none;
  /* 2.1.1.45 关键修复：theme-pro.css 给 .modal 加了入场动画「默认 opacity:0」，
     只有 .modal-overlay.show .modal 才恢复可见。表单节点被搬进内联宿主后已不在
     .modal-overlay 内 → 一直保持 opacity:0，表现就是「点了编辑但窗口不显示」。
     这里在内联场景下强制可见（历史记录视图的内联编辑同样受益）。 */
  opacity: 1;
}
.inline-modal-host .modal-header { padding: 0 0 12px; }
.inline-modal-host .modal-body { padding: 0; }
/* 小屏：双栏退化为单列 */
@media (max-width: 900px) {
  .memo-layout.cust-layout,
  .history-layout.cust-layout { grid-template-columns: 1fr; }
}

/* ===== 2.1.1.45 备忘录三栏：左列表 + 中详情 + 右编辑表单常驻（彻底取消弹窗）=====
   表单原本在 #memoModalOverlay 里、靠「把 .modal 节点搬进右栏宿主」实现内联，
   那套搬运在增强层加了入场动画后会失效（见 .inline-modal-host .modal 的 opacity 修复）。
   现改为表单直接长在视图右栏，选中条目即填充，点「编辑」只是把焦点交给它。 */
.memo-layout.cust-layout {
  grid-template-columns: 232px minmax(0, 1fr) minmax(300px, 380px);
  align-items: start;
}
/* 2.1.1.46：编辑表单收起时退化为两列，中栏详情占满 */
.memo-layout.cust-layout.no-edit { grid-template-columns: 232px minmax(0, 1fr); }
.memo-edit-col { min-width: 0; position: sticky; top: 16px; }
.memo-edit-col[hidden] { display: none !important; }
.memo-edit-card { position: static; }
.memo-edit-card .patent-detail-head { margin-bottom: 12px; }
/* 表单：窄栏下自适应两列，标题/内容/勾选项/操作区整行 */
.memo-edit-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.memo-edit-form .form-field { width: auto; }
.memo-edit-form .form-field-full,
.memo-edit-form .memo-form-checks,
.memo-edit-form .memo-form-actions { grid-column: 1 / -1; }
.memo-form-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
/* 中等宽度：先退化为双栏，编辑表单整行落到下方（避免三栏都过窄） */
@media (max-width: 1280px) {
  .memo-layout.cust-layout { grid-template-columns: 232px minmax(0, 1fr); }
  .memo-edit-col { grid-column: 1 / -1; position: static; }
}
@media (max-width: 900px) {
  /* ⚠ .no-edit 变体是 3 个类，优先级高于上面的 2 类规则，会把它盖回去 → 必须显式覆盖为单列。
     否则手机端备忘录仍是「232px 左栏 + 右侧详情」两列（表现为左栏很窄、详情挤在右侧）。 */
  .memo-layout.cust-layout,
  .memo-layout.cust-layout.no-edit { grid-template-columns: 1fr; }
  .memo-layout > .cust-sidebar { position: static; max-height: none; }
  .memo-edit-col { grid-column: auto; position: static; }
}
.rp-plan-preview { display: none; }
.print-only { display: none; }

/* 分类分布 */
.rp-cat-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.rp-cat-name { width: 96px; flex-shrink: 0; font-size: 13px; }
.rp-cat-bar { flex: 1; height: 10px; background: #f1f3f4; border-radius: 5px; overflow: hidden; }
.rp-cat-bar i { display: block; height: 100%; background: var(--blue, #1a73e8); border-radius: 5px; }
.rp-cat-num { width: 86px; flex-shrink: 0; font-size: 12px; color: #5f6368; text-align: right; }

/* 提交状态徽章（2.0.4.35：草稿 / 已提交） */
.rp-status {
  font-size: 12px; padding: 4px 10px; border-radius: 12px;
  white-space: nowrap; line-height: 1.6;
}
.rp-status.draft { background: #f1f3f4; color: #5f6368; }
.rp-status.submitted { background: var(--state-ok-bg, #e6f4ea); color: var(--state-ok, #137333); }
/* 2.0.4.37：查看他人周报时的只读提示 */
.rp-status.viewonly { background: var(--state-warn-bg, #fef7e0); color: var(--state-warn, #b06000); }

/* 已提交或查看他人周报时，计划框只读 */
.rp-plan-input[readonly] { background: #f1f3f4; color: #3c4043; cursor: default; }
.rp-plan-input[readonly]:focus { border-color: var(--border, #e0e0e0); background: #f1f3f4; }

/* ===== 2.0.4.37 提交对话框（接收人 + 抄送）===== */
.rp-submit-box {
  background: var(--surface, #fff); border-radius: 12px; padding: 22px 24px;
  width: min(460px, calc(100vw - 32px)); max-height: 84vh; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
}
.rp-submit-title { margin: 0 0 16px; font-size: 17px; font-weight: 600; color: var(--text-primary, #202124); }
.rp-submit-field { margin-bottom: 16px; }
.rp-submit-field > label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-primary, #202124); margin-bottom: 6px;
}
.rp-submit-select {
  width: 100%; box-sizing: border-box; height: 36px; padding: 0 8px;
  border: 1px solid var(--border, #e0e0e0); border-radius: 6px;
  font-size: 14px; color: var(--text-primary, #202124); background: var(--surface, #fff);
}
.rp-submit-select:focus { outline: none; border-color: var(--blue, #1a73e8); }
.rp-submit-hint { font-size: 12px; color: var(--text-secondary, #5f6368); margin-top: 6px; line-height: 1.5; }
.rp-cc-list {
  max-height: 168px; overflow-y: auto; padding: 8px;
  border: 1px solid var(--border, #e0e0e0); border-radius: 6px; background: #fafafa;
}
.rp-cc-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; font-size: 13px; color: var(--text-primary, #202124);
  cursor: pointer; border-radius: 4px;
}
.rp-cc-item:hover { background: #f1f3f4; }
.rp-cc-cb { width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.rp-submit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ===== 2.0.4.37 周报页 Tab（我的周报 / 我收到的）===== */
.rp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border, #e0e0e0); }
.rp-tab {
  padding: 9px 18px; font-size: 14px; cursor: pointer; color: var(--text-secondary, #5f6368);
  border: 0; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.rp-tab:hover { color: var(--text-primary, #202124); }
.rp-tab.active { color: var(--blue, #1a73e8); border-bottom-color: var(--blue, #1a73e8); font-weight: 600; }
.rp-tab-badge {
  display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 5px;
  font-size: 11px; line-height: 16px; text-align: center;
  background: var(--blue, #1a73e8); color: #fff; border-radius: 8px;
}

/* 收到的周报列表 */
.rp-inbox-list { display: flex; flex-direction: column; gap: 8px; }
.rp-inbox-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border, #e0e0e0); border-radius: 8px;
  background: var(--surface, #fff); cursor: pointer;
}
.rp-inbox-row:hover { border-color: var(--blue, #1a73e8); background: #f8fbff; }
.rp-inbox-main { flex: 1; min-width: 0; }
.rp-inbox-title { font-size: 14px; font-weight: 600; color: var(--text-primary, #202124); }
.rp-inbox-meta { font-size: 12px; color: var(--text-secondary, #5f6368); margin-top: 3px; }
.rp-inbox-tag {
  flex-shrink: 0; font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: #e8f0fe; color: var(--blue, #1a73e8);
}
.rp-inbox-tag.cc { background: var(--state-warn-bg, #fef7e0); color: var(--state-warn, #b06000); }
.rp-inbox-empty { padding: 28px; text-align: center; color: var(--text-secondary, #5f6368); font-size: 13px; }

.report-tip { font-size: 12px; color: var(--text-secondary, #5f6368); }

/* 轻提示（2.1.1.17 升级：非阻塞、多类型、可堆叠、点击关闭）— 不依赖任何库 */
.wl-toast-box {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  z-index: var(--z-toast); display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; max-width: 92vw;
}
.wl-toast {
  background: rgba(32, 33, 36, .92); color: #fff; font-size: 13px; line-height: 1.5;
  padding: 10px 18px; border-radius: 20px; box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  opacity: 0; transform: translateY(10px); transition: opacity .22s, transform .22s;
  pointer-events: auto; cursor: pointer; white-space: pre-line;
  max-width: min(92vw, 560px); word-break: break-word;
}
.wl-toast.show { opacity: 1; transform: translateY(0); }
.wl-toast-success { background: #1e8e3e; }
.wl-toast-error { background: var(--state-danger, #d93025); }
.wl-toast-warn { background: var(--state-warn, #b06000); }
@media (max-width: 640px) {
  .wl-toast-box { bottom: 16px; }
  .wl-toast { font-size: 12.5px; padding: 9px 14px; }
}

/* 全局请求进度条（2.1.1.18 P1-⑥）：所有 fetch 请求超 300ms 时在顶部显示，解决「点了没反应」 */
#__wlProgress {
  position: fixed; top: 0; left: 0; width: 100%; height: 2px; z-index: var(--z-progress);
  background: transparent; opacity: 0; pointer-events: none; overflow: hidden;
  transition: opacity .18s;
}
#__wlProgress.show { opacity: 1; }
#__wlProgress::after {
  content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 36%;
  background: var(--primary, #1a73e8); border-radius: 0 2px 2px 0;
  animation: wl-prog 1.1s ease-in-out infinite;
}
@keyframes wl-prog { 0% { left: -36%; } 100% { left: 100%; } }

/* 表格列头排序（2.1.1.19 P1-⑦）：点击表头排序，升序 ▲ / 降序 ▼ */
th { cursor: pointer; -webkit-user-select: none; user-select: none; }
th.sort-asc::after, th.sort-desc::after {
  content: ''; display: inline-block; margin-left: 5px; font-size: 10px;
  opacity: .85; vertical-align: middle;
}
th.sort-asc::after { content: '\25B2'; }
th.sort-desc::after { content: '\25BC'; }

/* 无权限元素（2.1.1.25 P-A）：保留位置但灰化禁用，悬停显示所需权限，避免「功能凭空消失」被误判为故障 */
.is-no-perm {
  opacity: .45;
  cursor: not-allowed !important;
  pointer-events: auto;
}
.is-no-perm:hover { opacity: .6; }

/* 通用列表分页条（2.1.1.25 P-B）：与媒体库分页同款，仅多页时渲染 */
.list-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.list-pager-info { font-size: 12.5px; color: var(--text-secondary, #5f6368); }
.list-pager .cust-pager-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* 全局搜索（2.1.1.22 P2-⑪）：Ctrl+K 或手机顶栏「搜索」按钮唤起 */
.gs-box { width: 560px; max-width: 92vw; }
.gs-result { margin-top: 12px; max-height: 320px; overflow-y: auto; }
.gs-hint { padding: 14px; text-align: center; color: var(--text-secondary, #5f6368); font-size: 13px; }
.gs-group { padding: 8px 4px 4px; font-size: 12px; color: var(--text-tertiary, #9aa0a6); }
.gs-item { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.gs-item:hover { background: var(--bg-secondary); }
.gs-name { font-size: 14px; color: var(--text-primary); }
.gs-sub { font-size: 12px; color: var(--text-secondary); }
.mobile-topbar-search {
  margin-left: auto; padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface, #fff); color: var(--text-primary);
  font-size: 13px; cursor: pointer;
}
/* 手机顶栏「未完成」入口：紧邻搜索左侧，两者一并靠右（☰ 与标题仍左对齐） */
.mobile-topbar-pending {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface, #fff); color: var(--text-primary); font-size: 13px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
}
.mobile-topbar-pending:active { background: var(--bg, #f1f3f4); }
.mobile-topbar .mobile-topbar-pending { margin-left: auto; }
.mobile-topbar .mobile-topbar-search { margin-left: 0; }

/* 手机端抽屉遮罩（2.1.1.21）：默认不显示，抽屉打开时铺满屏幕。
   关闭动作由 script.js 里已有的 sidebarMask 点击绑定负责，这里只负责“出现”。
   层级必须低于抽屉本体（.sidebar 用 --z-dropdown=80），故取 --z-header=70。 */
.sidebar-mask { display: none; }
body.sidebar-open .sidebar-mask {
  display: block; position: fixed; inset: 0;
  background: rgba(0, 0, 0, .4); z-index: var(--z-header);
}

/* 客户模块左栏窄屏横向标签条（2.1.1.21）：惯性滚动 + 细滚动条作为“可横向滑动”提示 + 搜索框不被压扁 */
@media (max-width: 900px) {
  .cust-sidebar { -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
  .cust-sidebar::-webkit-scrollbar { height: 3px; }
  .cust-sidebar::-webkit-scrollbar-thumb { background: var(--border, #e3e6ea); border-radius: 3px; }
  .cust-sidebar::-webkit-scrollbar-track { background: transparent; }
  .cust-sidebar .user-filter { flex: 0 0 auto; min-width: 150px; }
}

/* 媒体库分页（2.1.1.20 P1-⑤）：复用客户列表分页按钮，仅多页时渲染 */
.media-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
}
.media-pager-info { font-size: 12.5px; color: var(--text-secondary, #5f6368); }
.media-pager .cust-pager-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* 2.1.3-beta28：媒体库工具栏 / 选图器工具栏样式（此前仅有 DOM，无专属样式） */
.media-toolbar, .media-pick-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  /* 2.1.3-beta39：12 → 8，与其它模块工具栏的下间距对齐 */
  margin-bottom: 8px;
}
.media-toolbar .media-search, .media-pick-toolbar .media-pick-search {
  flex: 1 1 220px; min-width: 160px; max-width: 360px;
  padding: 6px 10px; font-size: 13px;
  background: var(--bg-input, #fff); border: 1px solid var(--border-color, #d0d5dd); border-radius: 8px;
  outline: none;
}
.media-toolbar .media-search:focus, .media-pick-toolbar .media-pick-search:focus {
  border-color: var(--blue, #1a73e8);
}
.media-toolbar .media-type-filter, .media-pick-toolbar .media-pick-ext {
  padding: 6px 8px; font-size: 13px;
  background: var(--bg-input, #fff); border: 1px solid var(--border-color, #d0d5dd); border-radius: 8px;
}
.media-toolbar button:disabled, .media-pick-toolbar button:disabled { opacity: .6; cursor: default; }
/* 2.1.3-beta39：媒体库页头排版统一 —— 「图片 / 文件」用的是字段管理同款大页签
   （.sub-tab 全局样式：8px 16px 内边距 + 底部通栏边框线，约 38px 高），放在页头和
   其它模块的 34px 按钮行不齐，看起来又高又乱。这里按页头规格改成 32px 胶囊；
   ⚠ 全局 .sub-tab 不动 —— 字段管理（#fieldSubTabs）/ 客户详情（#custDetailTabs）仍用原样式。 */
#mediaView .sub-tabs { border-bottom: none; padding-bottom: 0; gap: 6px; }
#mediaView .sub-tab { height: 32px; padding: 0 14px; line-height: 30px; border-radius: 16px; font-size: 13px; }
#mediaView .sub-tab:hover { transform: none; }
/* 2.1.4-beta8：上传按钮与「图片 / 文件」胶囊同高。
   上面把 sub-tab 收到 32px 后，旁边的 #mediaUploadBtn 仍是全局 40px → 页头同一行里
   高 8px（比其它模块的 4px 错位更明显）。窄屏块里另有 33px 的写法，这里统一到 32px
   后与 sub-tab 严格对齐（33px 本身还差 1px）。
   ⚠ 只命中页头直接子元素：媒体库内部空状态等处也有 .btn-primary，不受影响。 */
#mediaView .customer-top-actions > .btn-primary {
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
}
/* 灯箱翻图导航（openImageViewer 支持 list/index） */
.img-viewer-mask .iv-prev, .img-viewer-mask .iv-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(0, 0, 0, .5); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  display: none;
}
.img-viewer-mask .iv-prev { left: 24px; }
.img-viewer-mask .iv-next { right: 24px; }
.img-viewer-mask .iv-counter {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(0, 0, 0, .5); padding: 3px 10px; border-radius: 12px;
  display: none;
}

@media (max-width: 768px) {
  .report-paper { padding: 18px 16px; }
  .report-actions { width: 100%; }
  /* 2.0.4.38：删除草稿按钮同为操作区按钮，窄屏下与其他按钮一样等分拉伸 */
  .report-actions .btn-secondary,
  .report-actions .btn-primary,
  .report-actions .btn-danger { flex: 1; justify-content: center; }
  /* 窄屏进一步收窄卡片，尽量一行容纳更多项 */
  .rp-kpi { flex: 1 1 68px; min-width: 68px; max-width: 104px; padding: 8px 4px; }
  .rp-kpi-v { font-size: 16px; }
  .rp-kpi-l { font-size: 10px; }
  .rp-cat-name { width: 72px; }
  .rp-cat-num { width: 70px; }
}

/* ============================================================
   工作台（2.1.3 新增）：聚合首页，复用 settings-card 主题样式
   ============================================================ */
/* 2.1.3-beta39：工作台整体收紧（卡片间与首屏上方的留白偏大，首屏只能看到两排卡片） */
.workbench-wrap { padding: 10px; max-width: 1120px; margin: 0 auto; }
.workbench-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.workbench-sub { color: var(--muted, #888); font-size: 13px; }
.workbench-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
@media (max-width: 980px) { .workbench-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wb-card { margin: 0; }
.wb-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wb-card-title { font-weight: 600; font-size: 15px; }
.wb-card-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--accent, #1A73E8); color: #fff; font-size: 12px; line-height: 22px; text-align: center; }
.wb-card-body { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; }
/* 少内容卡片（备忘提醒/公告）自适应高度，不被统一 180px 截断，配合网格 align-items:start 避免空洞 */
#wbMemoGrid, #wbNoticeList { max-height: none; }
.wb-empty { color: var(--muted, #999); font-size: 13px; padding: 8px 2px; }
.wb-entry { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; border-radius: 8px; background: var(--hover, #f5f6f8); cursor: pointer; }
/* 列表受限渲染时的“更多/收起”入口 */
.wb-more-btn { margin-top: 4px; width: 100%; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.wb-more-btn:hover { background: var(--hover); }
.wb-entry:hover { background: var(--hover-strong, #eceef1); }
.wb-entry.is-done .wb-entry-title { text-decoration: line-through; opacity: .6; }
.wb-cust { border-left: 3px solid #ea4335; }
.wb-entry-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-entry-meta { font-size: 12px; color: var(--muted, #888); white-space: nowrap; }
.wb-week-progress { height: 6px; background: var(--hover, #eef0f3); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.wb-week-bar { height: 100%; background: var(--accent, #1A73E8); width: 0; transition: width .3s; }
.wb-notif { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.wb-notif:hover { background: var(--hover, #f5f6f8); }
.wb-notif.is-unread { background: var(--accent-soft, #eaf1fd); }
.wb-notif-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-notif-time { font-size: 12px; color: var(--muted, #888); white-space: nowrap; }
.workbench-quick { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.wb-card-full { grid-column: 1 / -1; }
.wb-report-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wb-report-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wb-pill { font-size: 12px; padding: 2px 10px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.wb-pill.is-none { background: #fdecea; color: #c0392b; }
.wb-pill.is-draft { background: #fff4e5; color: #b9770e; }
.wb-pill.is-done { background: #e6f4ea; color: #1e7e34; }
.wb-report-range { font-size: 13px; color: var(--muted, #888); }
.wb-card-foot { padding: 8px 14px 12px; text-align: right; }
.wb-card-empty { padding: 16px; color: var(--muted, #888); font-size: 13px; text-align: center; }
#wbMemoGrid { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 768px) {
  .workbench-grid { grid-template-columns: 1fr; }
  .workbench-wrap { padding: 12px; }
}

/* ============================================================
   打印 / 导出 PDF：仅输出周报正文
   机制：JS 给 body 加 .printing-report 后调用 window.print()，
        用户在打印对话框选「另存为 PDF」即可，零依赖。
   ============================================================ */
@media print {
  /* 隐藏全局框架与周报工具条 */
  body.printing-report .sidebar,
  body.printing-report .toolbar,
  body.printing-report .app-footer,
  body.printing-report .fab,
  body.printing-report .mobile-topbar,
  body.printing-report .mobile-bottom-nav,
  body.printing-report .sidebar-mask,
  body.printing-report .report-toolbar,
  body.printing-report .report-tip,
  body.printing-report .no-print { display: none !important; }

  /* 主区域占满纸张 */
  body.printing-report #app { display: block !important; }
  body.printing-report .main-area { margin: 0 !important; padding: 0 !important; }
  body.printing-report .content-area { padding: 0 !important; overflow: visible !important; }
  body.printing-report #reportView { display: block !important; }

  /* 正文去掉屏幕容器修饰 */
  body.printing-report .report-paper {
    border: 0 !important; border-radius: 0 !important;
    padding: 0 !important; box-shadow: none !important;
  }

  /* 打印时隐藏 textarea，改用预览文本（避免印出编辑框边框与滚动条） */
  body.printing-report .rp-plan-input { display: none !important; }
  body.printing-report .rp-plan-preview { display: block !important; }
  body.printing-report .print-only { display: block !important; }
}

/* ===== 2.1.1.7 F8：客户数据看板（纯 CSS 条形图）===== */
.btn-active { background: var(--blue, #1a73e8) !important; color: #fff !important; border-color: var(--blue, #1a73e8) !important; }
.board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.board-section { background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #e8eaed); border-radius: var(--radius-md, 10px); padding: 14px 16px; }
.board-title { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--text-primary, #202124); }
.board-bars { display: flex; flex-direction: column; gap: 8px; }
.board-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.board-bar-label { flex: 0 0 84px; color: var(--text-secondary, #5f6368); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-bar-track { flex: 1 1 auto; height: 12px; background: var(--bg, #f1f3f4); border-radius: 6px; overflow: hidden; }
.board-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #4285f4); border-radius: 6px; min-width: 2px; }
.board-bar-val { flex: 0 0 auto; color: var(--text-primary, #202124); font-variant-numeric: tabular-nums; }
.board-empty { color: var(--text-tertiary, #9aa0a6); font-size: 13px; padding: 8px 0; }
[data-theme="dark"] .board-bar-track { background: #2a2c2e; }
/* 暗色下渐变右端刻意保留字面量深蓝：此处需要「浅蓝→深蓝」的层次感，
   若改用 var(--blue)，暗色下 --blue 为 #7EA6FF，与左端 #8ab4f8 近乎同色，渐变会被抹平。 */
[data-theme="dark"] .board-bar-fill { background: linear-gradient(90deg, #8ab4f8, #1a73e8); }
@media (max-width: 640px) {
  .board-grid { grid-template-columns: 1fr; }
  .board-bar-label { flex-basis: 64px; }
}

/* ===== 产品模块 UI 美化（v2.1.1.14）=====
   只改外观不动结构：Tab 分段控件、侧栏列表卡片、详情 Hero、规格书卡片化编辑、
   A4 纸张式预览、模版页分区卡片、编辑弹窗双列。颜色一律走主题变量，暗色模式自动适配。 */

/* 顶部：分段控件式 Tab（替代原来的下划线 Tab） */
#productView .section-header { margin: 0 0 14px; align-items: center; gap: 12px; }
.product-tabs {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px;
  background: var(--bg-secondary, #f1f3f4); border-radius: 999px;
}
.product-tab {
  border: none; border-bottom: none; background: transparent; color: var(--text-secondary, #5f6368);
  padding: 7px 18px; font-size: 14px; font-weight: 600; line-height: 1.2; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: background .18s var(--ease, ease), color .18s var(--ease, ease), box-shadow .18s var(--ease, ease);
}
.product-tab:hover { color: var(--blue, #1a73e8); }
.product-tab.active { background: var(--white, #fff); color: var(--blue, #1a73e8); box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.12)); }
.product-top-actions { gap: 10px; }
.product-top-actions > .btn-secondary { height: 34px; border-radius: 10px; padding: 0 14px; font-size: 13px; }
.product-top-actions > .btn-primary { height: 34px; padding: 0 16px; font-size: 13px; }

/* 侧栏：搜索框 + 两行式列表项 */
.pm-search { padding: 0 4px 10px; }
.pm-search .user-filter { width: 100%; height: 32px; }
.product-layout > .cust-sidebar, .memo-layout > .cust-sidebar, .history-layout > .cust-sidebar { padding: 14px 12px; }
.product-layout .cust-nav-item.pm-nav-item,
.project-layout .cust-nav-item.pm-nav-item,
.patent-layout .cust-nav-item.pm-nav-item,
.memo-layout .cust-nav-item.pm-nav-item,
.history-layout .cust-nav-item.pm-nav-item {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  padding: 8px 10px; margin-bottom: 2px; border: 1px solid transparent; border-radius: 10px;
  white-space: normal; overflow: visible; text-overflow: clip;
  transition: background .15s var(--ease, ease), border-color .15s var(--ease, ease);
}
.product-layout .cust-nav-item.pm-nav-item:hover,
.project-layout .cust-nav-item.pm-nav-item:hover,
.patent-layout .cust-nav-item.pm-nav-item:hover,
.memo-layout .cust-nav-item.pm-nav-item:hover,
.history-layout .cust-nav-item.pm-nav-item:hover { background: var(--bg-secondary, #f1f3f4); }
.product-layout .cust-nav-item.pm-nav-item.active,
.project-layout .cust-nav-item.pm-nav-item.active,
.patent-layout .cust-nav-item.pm-nav-item.active,
.memo-layout .cust-nav-item.pm-nav-item.active,
.history-layout .cust-nav-item.pm-nav-item.active {
  background: var(--blue-light, #e8f0fe); color: var(--blue, #1a73e8);
  border-color: color-mix(in srgb, var(--blue, #1a73e8) 32%, transparent); box-shadow: none;
}
.pm-nav-main { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.pm-nav-name { flex: 1 1 auto; font-size: 13.5px; font-weight: 600; color: var(--text-primary, #202124); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-nav-item.active .pm-nav-name { color: var(--blue, #1a73e8); }
.pm-nav-model { flex: 0 0 auto; max-width: 45%; font-size: 11.5px; color: var(--text-tertiary, #9aa0a6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-nav-sub { display: flex; align-items: center; font-size: 11.5px; color: var(--text-tertiary, #9aa0a6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-nav-dot { flex: 0 0 auto; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.pm-empty { color: var(--text-tertiary, #9aa0a6); font-size: 13px; padding: 10px 12px; text-align: center; line-height: 1.6; }
/* B3：产品侧栏列表项加主图缩略图（仅产品模块用横向布局，避免影响项目/专利等模块的纵向排版） */
.product-layout .cust-nav-item.pm-nav-item { flex-direction: row; align-items: center; gap: 8px; }
.product-layout .pm-nav-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-nav-thumb { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 7px; overflow: hidden; background: linear-gradient(135deg, #e9eaee, #f4f5f7); display: flex; align-items: center; justify-content: center; }
.pm-nav-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-nav-thumb .pm-nav-ph { width: 100%; height: 100%; }

/* ===== 项目管理 / 专利管理：左右双栏（左列表 + 右详情）===== */
/* 右栏内再分两列会过窄，故放宽为可伸缩；窄屏直接堆叠 */
.project-layout .project-detail-body { grid-template-columns: minmax(260px, 320px) 1fr; }
.project-layout .project-detail-header { display: flex; align-items: center; gap: 10px; }
.project-layout .project-detail-header .section-title { flex: 1 1 auto; min-width: 0; }
.patent-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.patent-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 18px; }
.patent-detail-grid .project-info-row { padding: 6px 0; }
#pdTitle { margin: 0 0 10px; }

/* ===== 专利「关联产品」（2.1.4-beta4）=====
   构成：已选 chips +「＋ 添加产品」下拉，逐条添加（不用勾选长列表）。
   chips 与详情页显示**型号**，下拉选项显示「名称（编号）型号」便于查找。
   所有选择器都带 .patent-products-pick 作用域，不碰任何全局类。 */
.patent-products-pick .pp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.patent-products-pick .pp-chips {
  flex: 1 1 240px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 34px; padding: 5px 8px;
  border: 1px solid var(--border, #e3e6ea); border-radius: 8px; background: var(--surface, #fff);
}
.patent-products-pick .pp-empty-txt { font-size: 12px; color: var(--muted, #80868b); padding: 2px 0; }
.patent-products-pick .pp-chip {
  display: inline-flex; align-items: center; gap: 2px;
  height: 24px; padding: 0 4px 0 10px; border-radius: 12px;
  background: rgba(26, 115, 232, 0.10); color: var(--blue, #1a73e8);
  font-size: 12px; line-height: 24px;
}
.patent-products-pick .pp-chip-x { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.patent-products-pick .pp-chip-x:hover { color: var(--error, #d93025); }
.patent-products-pick .pp-picker { flex: 0 1 260px; min-width: 170px; }
.patent-products-pick .pp-input {
  width: 100%; box-sizing: border-box; height: 34px; padding: 0 10px;
  border: 1px solid var(--border, #e3e6ea); border-radius: 8px;
  background: var(--surface, #fff); color: var(--text-1, #202124); font-size: 13px; outline: none;
}
.patent-products-pick .pp-input:focus { border-color: var(--blue, #1a73e8); }
/* 建议面板挂在 body 上（fixed 定位，否则会被弹窗滚动容器裁掉），因此不能带
   .patent-products-pick 前缀；改用专利专属前缀 patent-pp- 避免与任何共享类撞名。 */
.patent-pp-panel {
  position: fixed; z-index: 1200; max-height: 220px; overflow-y: auto;
  padding: 4px; border: 1px solid var(--border, #e3e6ea); border-radius: 8px;
  background: var(--surface, #fff); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.patent-pp-item {
  display: block; width: 100%; box-sizing: border-box; padding: 7px 10px;
  border: none; background: transparent; border-radius: 6px; cursor: pointer;
  text-align: left; font-size: 13px; color: var(--text-1, #202124);
  font-family: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.patent-pp-item:hover { background: var(--surface-2, #f1f3f4); }
.patent-pp-empty { padding: 10px; text-align: center; font-size: 12px; color: var(--muted, #80868b); }

/* 产品详情「相关专利」表格里的跳转链接（2.1.4-beta6）：
   .btn-link 默认是灰色次要色，这里强调可点，避免被当成普通文字。 */
.pd-patent-link { color: var(--blue, #1a73e8); padding: 0; font-size: inherit; text-align: left; }
.pd-patent-link:hover { color: var(--blue-dark, #1765cc); }
@media (max-width: 1200px) {
  .project-layout .project-detail-body { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .project-layout, .patent-layout { grid-template-columns: 1fr; }
  .project-layout > .cust-sidebar, .patent-layout > .cust-sidebar { position: static; max-height: none; }
  /* 2.1.1.39 备忘录 / 历史记录：窄屏堆叠，侧栏取消吸附与限高 */
  .memo-layout.cust-layout, .history-layout.cust-layout { grid-template-columns: 1fr; }
  .memo-layout > .cust-sidebar, .history-layout > .cust-sidebar { position: static; max-height: none; }
}

/* 手机端「历史记录」左栏：筛选器横排 + 记录列表纵向铺满。
   通用规则在窄屏把 .cust-sidebar 变成横向滚动条（display:flex; flex-wrap:nowrap; overflow-x:auto），
   而历史记录左栏有 3 个 min-width:150px 的筛选下拉 + 记录列表，横排后下拉占满整条，
   记录列表被挤到几乎看不见 —— 从手机顶栏「未完成」跳转进来时表现尤为明显。
   故历史记录单独改为纵向布局：筛选器自动换行横排，列表独占整行纵向展示。 */
@media (max-width: 900px) {
  .history-layout > .cust-sidebar { display: flex; flex-direction: row; flex-wrap: wrap; overflow-x: visible; }
  .history-layout > .cust-sidebar .cust-sidebar-head { width: 100%; }
  .history-layout > .cust-sidebar .pm-search { flex: 1 1 120px; min-width: 110px; }
  .history-layout > .cust-sidebar .user-filter { flex: 1 1 auto; min-width: 0; width: 100%; }
  .history-layout > .cust-sidebar .cust-nav { flex: 1 1 100%; flex-direction: column; flex-wrap: nowrap; }
  /* 手机端历史记录也显示筛选下拉：否则被全局 .user-filter{display:none!important} 隐藏，
     只剩一片空白「空档」；且用户从「未完成」进入时需要看到/切换当前筛选状态。 */
  .history-layout > .cust-sidebar .pm-search .user-filter { display: block !important; }
}

/* ===== 手机端：内容一律按视口宽度排布，禁止横向滑动 =====
   做法：① 关键容器与弹性/栅格子项加 max-width:100% + min-width:0，使其可收缩而非撑破视口；
        ② 页面级兜底 overflow-x:hidden，彻底消除左右滑动。
   注：表格等自身带 overflow-x:auto 的内部滚动不受影响，仅禁止整页横向滚动。 */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .content-area, .cust-layout, .cust-sidebar, .cust-content,
  .stats-row, .week-top, .week-grid, .settings-card, .modal-body { max-width: 100%; min-width: 0; }
  /* ⚠ 不可对 .stats-row > * 设 min-width:0 —— 会覆盖 .stat-card 的 min-width:33.333%，
     导致统计卡挤成一行、标签折行（卡片排版/位置错乱的根因）。仅放开可能撑破宽度的栅格子项。 */
  .cust-layout > *, .week-top > *, .week-grid > * { min-width: 0; }
  /* 长文本/长编号在窄屏断行，避免把行撑宽 */
  .pm-nav-name, .history-nav-sub, .entry-title { word-break: break-word; }
}

/* 详情头部：Hero 卡片（左图右信息 + 信息徽标） */
.pm-hero {
  display: flex; align-items: stretch; gap: 0;
  background: var(--white, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 16px;
  padding: 0; box-shadow: var(--shadow-2, 0 4px 12px rgba(0,0,0,.12));
  overflow: hidden;
}
.pm-hero-media {
  /* 2.1.1.35：产品图统一 1:1；align-self:flex-start 使右侧内容更高时图区保持正方形不随行拉伸 */
  flex: 0 0 120px; width: 120px; aspect-ratio: 1 / 1; align-self: flex-start;
  background: linear-gradient(135deg, var(--bg-secondary, #f1f3f4) 0%, color-mix(in srgb, var(--blue, #1a73e8) 6%, var(--bg-secondary, #f1f3f4)) 100%);
  border-right: 1px solid var(--border, #e5e7eb);
  display: flex; align-items: center; justify-content: center;
}
.pm-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-hero-ph {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-tertiary, #9aa0a6);
}
.pm-hero-ph b { font-weight: 500; }
.pm-hero-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 16px 18px;
}
.pm-hero-title {
  font-size: 22px; font-weight: 700; line-height: 1.25;
  color: var(--text-primary, #202124);
}
.pm-hero-subtitle {
  display: inline-block; margin-left: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-tertiary, #9aa0a6);
  background: var(--bg-secondary, #f1f3f4); padding: 3px 10px; border-radius: 999px; vertical-align: middle;
}
.pm-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pm-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px;
  font-size: 12px; line-height: 1; border-radius: 999px;
  background: var(--bg-secondary, #f1f3f4); color: var(--text-secondary, #5f6368);
  border: 1px solid transparent;
}
.pm-chip i { font-style: normal; font-size: 11px; opacity: .65; }
.pm-chip.is-code { font-variant-numeric: tabular-nums; letter-spacing: .3px; background: #f5f8fd; border-color: #d9e2f7; }
.pm-chip.is-on { background: var(--green-light, #e6f4ea); color: var(--green-dark, #1e8e3e); border-color: color-mix(in srgb, var(--green-dark, #1e8e3e) 18%, transparent); }
.pm-chip.is-off { background: var(--red-light, #fce8e6); color: var(--red-dark, #c5221f); border-color: color-mix(in srgb, var(--red-dark, #c5221f) 18%, transparent); }
.pm-hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border, #e5e7eb);
}
.pm-hero-actions > button { height: 34px; padding: 0 16px; border-radius: 10px; font-size: 13px; }
.product-actions { display: none; }
@media (max-width: 640px) {
  .pm-hero-media { flex: 0 0 92px; width: 92px; min-height: 92px; }
  .pm-hero-main { padding: 12px 14px; }
  .pm-hero-title { font-size: 18px; }
  .pm-hero-subtitle { margin-left: 0; margin-top: 6px; display: inline-block; }
}

/* 规格书编辑区：内嵌浅底容器 + 模块卡片 */
.spec-builder {
  margin-top: 4px; padding: 14px;
  background: var(--bg-secondary, #f1f3f4); border: 1px solid var(--border, #e5e7eb); border-radius: 14px;
}
.spec-builder-bar { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--border, #e5e7eb); }
.spec-builder-bar strong { font-size: 14px; color: var(--text-primary, #202124); }
.spec-builder-bar .user-filter { height: 32px; }
.spec-builder-bar .btn-sm { height: 32px; border-radius: 10px; }
.spec-inst {
  border: 1px solid var(--border, #e5e7eb); border-radius: 12px; overflow: hidden;
  background: var(--white, #fff); box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.08));
}
.spec-inst-head {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 12px;
  background: color-mix(in srgb, var(--blue, #1a73e8) 7%, var(--white, #fff));
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.spec-inst-head strong { font-size: 13.5px; color: var(--text-primary, #202124); }
.pm-idx {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; font-style: normal;
  background: var(--blue, #1a73e8); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.spec-inst-ops { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.spec-inst-fields { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.pm-icon-btn {
  width: 26px; height: 26px; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--text-secondary, #5f6368); font-size: 13px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s var(--ease, ease), color .15s var(--ease, ease), border-color .15s var(--ease, ease);
}
.pm-icon-btn:hover { background: var(--blue-light, #e8f0fe); color: var(--blue, #1a73e8); border-color: color-mix(in srgb, var(--blue, #1a73e8) 24%, transparent); }
.pm-icon-btn.is-danger:hover { background: var(--red-light, #fce8e6); color: var(--red-dark, #c5221f); border-color: color-mix(in srgb, var(--red, #ea4335) 24%, transparent); }
.spec-field-row { align-items: center; gap: 10px; padding: 2px; }
.spec-field { gap: 5px; margin-bottom: 0; }
.spec-field > span { font-size: 12px; font-weight: 500; color: var(--text-secondary, #5f6368); }
.spec-field .user-filter { width: 100%; height: 34px; }
.spec-field-ops { padding-top: 0; gap: 2px; opacity: .5; transition: opacity .15s var(--ease, ease); }
.spec-field-row:hover .spec-field-ops { opacity: 1; }

/* 规格书预览：A4 纸张感（打印时去阴影去内边距） */
.spec-doc {
  max-width: 820px; margin: 4px auto 0; padding: 34px 38px;
  background: var(--surface, #fff); color: #202124; border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px; box-shadow: var(--shadow-2, 0 4px 12px rgba(0,0,0,.12));
}
.spec-doc-head { text-align: center; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--blue); }
.spec-doc-sub { margin-top: 6px; font-size: 12px; color: #5f6368; letter-spacing: .3px; }
.spec-module { margin-bottom: 16px; break-inside: avoid; page-break-inside: avoid; }
.spec-fields { border: 1px solid #e3e6ea; border-radius: 8px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.spec-fields th, .spec-fields td { border: none; border-bottom: 1px solid #edeff2; padding: 8px 12px; font-size: 13px; }
.spec-fields tr:last-child th, .spec-fields tr:last-child td { border-bottom: none; }
.spec-fields th { width: 34%; background: #f5f8fd; color: #33475b; font-weight: 600; border-right: 1px solid #edeff2; }
.spec-fields tr:nth-child(even) td { background: #fafbfd; }
@media print {
  .spec-doc { max-width: none; margin: 0; padding: 0; border: none; border-radius: 0; box-shadow: none; }
}

/* 规格书模版页：左列表卡片 + 右侧分区卡片 */
.ml-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 2px;
  border: 1px solid transparent; border-bottom: 1px solid transparent; border-radius: 10px;
  transition: background .15s var(--ease, ease), border-color .15s var(--ease, ease);
}
.ml-item:hover { background: var(--bg-secondary, #f1f3f4); }
.ml-item.active { background: var(--blue-light, #e8f0fe); border-color: color-mix(in srgb, var(--blue, #1a73e8) 32%, transparent); }
.ml-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ml-item-main b { font-size: 13px; color: var(--text-primary, #202124); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-item-main small { font-size: 11.5px; color: var(--text-tertiary, #9aa0a6); }
.ml-item-ops { flex: 0 0 auto; margin-left: auto; opacity: 0; transition: opacity .15s var(--ease, ease); }
.ml-item:hover .ml-item-ops, .ml-item.active .ml-item-ops { opacity: 1; }
.ml-card {
  background: var(--white, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 14px;
  box-shadow: var(--shadow-2, 0 4px 12px rgba(0,0,0,.12)); margin-bottom: 16px; overflow: hidden;
}
.ml-card-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--blue, #1a73e8) 9%, var(--white, #fff)) 0%, color-mix(in srgb, var(--blue, #1a73e8) 4%, var(--white, #fff)) 100%);
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 14px; font-weight: 700; color: var(--text-primary, #202124);
}
.ml-card-head::before { content: ''; width: 4px; height: 16px; border-radius: 3px; background: var(--blue, #1a73e8); }
.ml-card-tip { font-size: 12px; font-weight: 400; color: var(--text-tertiary, #9aa0a6); margin-left: 4px; }
.ml-card-body { padding: 16px; }
.ml-card.is-import { border-color: color-mix(in srgb, var(--blue, #1a73e8) 30%, var(--border, #e5e7eb)); }
.ml-card.is-import .ml-card-head { background: linear-gradient(90deg, color-mix(in srgb, var(--blue, #1a73e8) 14%, var(--white, #fff)) 0%, color-mix(in srgb, var(--blue, #1a73e8) 5%, var(--white, #fff)) 100%); }
.ml-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ml-row .user-filter { height: 36px; }
.ml-cat { flex: 1 1 180px; min-width: 160px; }
.ml-sort { flex: 0 0 92px; }
.ml-def { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary, #5f6368); }
.ml-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; padding-top: 4px; }
.ml-foot > button { height: 36px; padding: 0 18px; border-radius: 10px; font-size: 13px; }
#mlPaste { width: 100%; min-height: 96px; resize: vertical; font-size: 13px; line-height: 1.5; }

/* 模版参数行：序号 + 参数名 + 默认值 + 类型 + 操作（网格对齐，候选值整行） */
#mlFields { counter-reset: mlf; display: flex; flex-direction: column; gap: 10px; }

/* ===== 2.1.1.53 模具管理 ===== */
/* 状态徽标（active 在用 / repairing 维修 / scrapped 报废） */
.md-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; line-height: 1.6; white-space: nowrap; }
.md-status.is-ok   { background: #e6f4ea; color: #137333; }
.md-status.is-warn { background: #fef7e0; color: #b06000; }
.md-status.is-off  { background: #f1f3f4; color: #5f6368; }
/* 关联产品标签（一个模具可关联多个产品，窄列内换行展示）；× 为弹窗内移除按钮 */
.md-prod-tag { display: inline-block; padding: 1px 6px; margin: 1px 2px 1px 0; border-radius: 6px; background: #e8f0fe; color: #1967d2; font-size: 12px; }
.md-prod-x { border: 0; background: transparent; color: inherit; font-size: 13px; line-height: 1; cursor: pointer; padding: 0 0 0 3px; }
.md-prod-x:hover { color: #d93025; }
/* 弹窗内关联产品：下拉 + 添加按钮一行；已选标签区在其下 */
.md-prod-pick { display: flex; align-items: center; gap: 6px; }
.md-prod-sel { margin-top: 6px; padding: 4px 0; }
/* 产品详情页「关联模具」区块（只在本产品确实被模具关联时才显示） */
.pm-mold-box { margin: 12px 0; }
.pm-mold-box .media-table { margin-top: 6px; }
.mlf-row {
  counter-increment: mlf;
  display: grid; align-items: center; gap: 10px; padding: 12px 14px;
  grid-template-columns: auto minmax(120px, 1.4fr) minmax(120px, 1fr) 92px auto auto;
  border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  background: var(--white, #fff); box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.08));
}
.mlf-row::before {
  content: counter(mlf); width: 24px; height: 24px; border-radius: 7px;
  background: color-mix(in srgb, var(--blue, #1a73e8) 12%, transparent); color: var(--blue, #1a73e8);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.mlf-row .user-filter { height: 36px; font-size: 13px; }
.mlf-row .user-filter::placeholder { font-size: 12px; color: var(--text-tertiary, #9aa0a6); }
.mlf-opts {
  grid-column: 1 / -1;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border, #e5e7eb);
}
.mlf-opts .user-filter { width: 100%; }
.mlf-toolbar { margin-top: 14px; gap: 10px; }
@media (max-width: 760px) {
  .mlf-row { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px 12px; }
  .mlf-row::before { grid-row: 1; }
  .mlf-opts-btn, .mlf-del { grid-column: auto; }
}

/* 新增/编辑产品弹窗：双列表单（窄屏回落单列） */
.pe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.pe-field { display: block; margin-bottom: 12px; }
.pe-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary, #5f6368); margin-bottom: 4px; }
.pe-field .user-filter { width: 100%; }
.pe-img-field { margin-top: 2px; }
.product-img-pick { min-height: 96px; border-radius: 10px; background: var(--bg-secondary, #f1f3f4); }
/* 2.1.1.35：产品编辑弹窗的选图框统一 1:1 正方形（160×160），图片 cover 填满 */
.pe-img-field .product-img-pick { width: 160px; min-height: 0; aspect-ratio: 1 / 1; }
.pe-img-field .product-img-pick img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; border-radius: 8px; }
@media (max-width: 560px) { .pe-grid { grid-template-columns: 1fr; } }

@media print {
  /* 避免章节被分页截断 */
  body.printing-report .rp-section { break-inside: avoid; page-break-inside: avoid; }
  body.printing-report .rp-head { break-after: avoid; page-break-after: avoid; }

  /* 打印配色固定为浅色，避免暗色主题下印出发灰内容 */
  body.printing-report .rp-sec-title,
  body.printing-report .rp-kpi-v,
  body.printing-report .rp-tag { color: #1a73e8 !important; }
  body.printing-report .report-paper,
  body.printing-report .rp-meta,
  body.printing-report .rp-cat-num { color: #333 !important; }
  body.printing-report .rp-kpi { background: #f5f5f5 !important; }
}

/* ===== 2.1.1.50 出货规则书（ship-spec.js）===== */
/* 列表副信息（客户编号 / 业务员编号）：弱化显示，不抢主字段视觉 */
.ss-sub { font-size: 12px; opacity: .65; margin-top: 2px; }
/* 「最新」版本徽标：绿色弱化底 + 绿字，深浅主题下均可辨识 */
.ss-badge-new { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 9px; font-size: 11px; line-height: 16px; background: rgba(34,197,94,.14); color: #16a34a; }
/* 备注列：长文本单行截断，完整内容走 title 悬停 */
.ss-remark { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-file-ok { color: #16a34a; }
/* 2.1.3-beta22：规则书列表列较多，改为不换行 + 容器横向滚动，避免每列被挤成多行 */
#ssList { overflow-x: auto; }
#ssList .media-table th, #ssList .media-table td { white-space: nowrap; vertical-align: middle; }
/* 2.1.3-beta26：规格书编号一键复制（默认弱化，避免抢编号本身视觉；hover 变主题蓝） */
.ss-copy-code { margin-left: 6px; padding: 0; border: none; background: none; color: var(--text-tertiary, #9aa0a6); cursor: pointer; line-height: 0; vertical-align: middle; }
.ss-copy-code:hover { color: var(--link, #1a73e8); }

/* ===== 手机端·全模块复查修复（2026-10-12 全量审计后统一落地）=====
   以下为逐模块审计发现的窄屏缺陷，统一置于文件末尾，靠「后置顺序」确保覆盖生效：
   ① 客户列表卡片化后仍 min-width:760px → 每张卡片 760px，容器横滚，卡片化形同虚设
   ② 客户新增/编辑弹窗 #customerForm：ID 选择器(1,0,0)，类级 ≤900 覆盖压不过，须同 ID 后置覆盖
   ③ 登录日志行 .ll-row：5 条固定轨道≈470px → 窄屏必须横向滑，改为两行
   ④ 全局搜索面板固定 420px 且无 max-width → 窄屏左溢出
   ⑤ 报表日期文案 min-width:220px / 规格书字段操作区 nowrap → 窄屏挤压
   ⑥ 列设置浮层两列 + nowrap → 超窄屏向左扩张被裁切 */

@media (max-width: 900px) {
  /* ① 客户列表：卡片化后取消表格最小宽度（否则仍 760px，横向滚动没消除） */
  .customer-table { min-width: 0; }
  /* ② 客户新增/编辑弹窗：#customerForm 是 ID 选择器，普通类级 ≤900 覆盖压不过，
     此处用同一 ID + 后置顺序覆盖为单列，避免窄屏两列把输入框压扁 */
  #customerForm { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* ③ 登录日志行：原 90/110/90/130 + 1fr ≈470px，窄屏只能横向滑。
     改为两行：第一行 时间 + 用户 + 动作；第二行 IP + 详情。 */
  .ll-row { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
  .ll-row .ll-time { flex: 0 0 auto; }
  .ll-row .ll-user { flex: 1 1 auto; min-width: 0; }
  .ll-row .ll-act { flex: 0 0 auto; }
  .ll-row .ll-ip { flex: 0 0 auto; text-align: left; }
  .ll-row .ll-detail { flex: 1 1 0; min-width: 0; }
  /* ④ 全局搜索面板：固定 420px 且无 max-width，窄屏会左溢出 */
  .search-panel { max-width: calc(100vw - 32px); }
  /* ⑤ 报表日期文案 / 规格书字段操作区：放开最小宽与换行，避免挤压 */
  .report-range-text { min-width: 0; }
  .spec-field-ops { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  /* ⑥ 列设置 / 标签筛选浮层：两列 + nowrap 在超窄屏向左扩张被裁切 */
  .col-chooser { grid-template-columns: 1fr; min-width: 0; }
}

/* ===== 手机端·概览卡片置顶与工具栏整齐（2026-10-12 第二轮复查）=====
   基线对齐「统计分析」页（#statsView）：概览卡片位于视图最顶部，工具栏左对齐、换行整齐。
   ① 客户/项目/专利/历史 均为「左栏导航 + 右栏内容」双栏结构（.cust-layout > .cust-sidebar + main.cust-content），
      而统计卡片被包在 main.cust-content 内 → 窄屏退化为单列时，卡片被左栏导航压在下面。
      改法：窄屏把 main.cust-content 设为 display:contents「去盒子化」，让卡片与左栏导航成为
      .cust-layout 的同一批网格子项，再给卡片容器 order:-1 提到最前。仅窄屏生效，桌面端零变化。
      注意：去盒子化后子元素直接成为网格项，grid 默认 min-width:auto 会被内容撑破 → 需补 min-width:0。
   ② 4 张卡的模块窄屏改 2 列（原 33.333% 会排成 3+1，末张孤行；客户页 110px 窄卡上
      「客户总数」与右上角「本月新增」趋势标注必然重叠）。工作记录页 3 卡不在此列，维持 3 列。
   ③ 产品页 section-header 被文件后段的全屏规则改回 align-items:center → tabs 居中、行距 12px 过大。
   ④ 客户工具栏 justify-content:flex-end + 换行 → 每行右对齐、长短参差，视觉散乱。
   ⑤ 用户列表窄屏本应「两排」：.user-row-info 的 flex-basis:auto 会按内容占满第一行，
      把部门/职位挤到第二行、操作按钮独占第三行 = 三排。 */

@media (max-width: 900px) {
  /* ① 概览卡片置顶（对齐统计分析页） */
  #customerView .cust-layout,
  #projectView .cust-layout,
  #patentView .cust-layout,
  #historyView .cust-layout { gap: 12px; }
  #customerView .cust-content,
  #projectView .cust-content,
  #patentView .cust-content,
  #historyView .cust-content { display: contents; }
  #customerView .cust-content > *,
  #projectView .cust-content > *,
  #patentView .cust-content > *,
  #historyView .cust-content > * { min-width: 0; }
  /* 卡片容器提到最前：客户/专利/历史是 .stats-row 直挂内容区；
     项目多一层 #projectListView（内部仅含 .stats-row），故直接提升该层 */
  #customerView .cust-content > .stats-row,
  #patentView .cust-content > .stats-row,
  #historyView .cust-content > .stats-row,
  #projectView #projectListView { order: -1; }

  /* ② 4 卡模块：窄屏 2×2（含统计分析页、产品页概览卡片） */
  #customerDashboard .stat-card,
  #projectView .stat-card,
  #patentView .stat-card,
  #historyView .stat-card,
  #productView .stat-card,
  #statsView .stat-card { min-width: calc(50% - 5px); }
  /* 客户首卡右上角有「本月新增」趋势标注：给左侧小标签让出空间，窄卡不再重叠 */
  #customerDashboard .stat-card:first-child .stat-label { padding-right: 56px; }

  /* ②-b 小屏统计卡收紧（2.1.3-beta11：布局属性由 theme-pro.css 迁来，值不变、视觉不变。
     迁来原因：gap / min-height / padding 属布局，与 theme-pro 的「视觉主题」职责混在一起，
     改一处易忘另一处（见 docs/UI优化待办.md #2）。字号与装饰圆仍留在 theme-pro.css。） */
  .stats-row { gap: 10px; }
  .stat-card { min-height: 56px; padding: 8px 10px; }

  /* ⑧ 窄屏卡片压缩（2.1.3-beta12，待办 #5）：.stat-card 全局固定 height:100px（约 1129 行），
     4 卡模块窄屏 2×2 加 gap 约 210px 高，吃掉首屏、要往下滚才看得到列表。
     窄屏压到 72px（2×2 ≈ 154px，省约 56px），label + value 仍放得下；桌面端不变。 */
  .stat-card { height: 72px; }

  /* ⑦ 768–900px 区间补「给固定顶栏让位」（2.1.3-beta11 复查发现）：
     .content-area 的 padding-top 此前只写在 ≤768 块（本文件约 5547 行），
     而 mobile-topbar 从 ≤900 就开始显示（约 3075 行）→ 768~900 区间的全部内容
     （含本版新增的手机端周导航）会被 fixed 顶栏压住。此处补齐；≤768 块在文件更后面，
     其同值规则仍优先生效，两者一致。与待办 #6（平板区间）相关。 */
  .content-area { padding-top: calc(52px + 14px + env(safe-area-inset-top)); }

  /* ⑥ 手机端周导航（2.1.3-beta11）：顶栏 #dateNav 随 .toolbar 一起隐藏后，
     手机在周视图里无法切周/看不到周次 → 在周视图顶部补一条。
     复用 .date-range / .week-pill / .icon-btn 既有样式，保持与顶栏一致。 */
  .mobile-datenav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 6px 10px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  /* .date-range 全局带 white-space:nowrap（本文件 992 行），320px 窄屏放不下完整日期区间。
     min-width:0 只解决 flex 收缩，不解决 nowrap 溢出 → 再补裁切，溢出时显示省略号，
     避免把整条导航撑破（.#weekView 内容被顶宽会导致横向滚动）。 */
  .mobile-datenav .date-range {
    flex: 1 1 auto; min-width: 0; text-align: center; font-size: 14px;
    overflow: hidden; text-overflow: ellipsis;
  }
  .mobile-datenav .week-pill { flex-shrink: 0; }

  /* ③ 产品页：tabs 与按钮行左对齐、行距收紧 */
  #productView .section-header { align-items: flex-start; gap: 8px; margin: 0 0 12px; }
  #productView .product-top-actions { width: 100%; justify-content: flex-start; }

  /* ④ 客户工具栏：左对齐整齐换行，搜索框独占一行 */
  #customerView .customer-top-actions { justify-content: flex-start; row-gap: 8px; }
  #customerView .customer-top-actions > #custSearch { flex: 1 1 100%; min-width: 0; }
}

@media (max-width: 768px) {
  /* ⑤ 用户列表「两排」（2.1.3-beta14 修正：此前实为三排）
     第一排 = 头像 + 姓名·账号 + 部门 + 职位；第二排 = 操作按钮。
     ⚠ 根因：.user-row-info 全局是 flex-direction:column（约 2299 行）→ 姓名与账号各占一行，
       即使操作按钮已 flex:0 0 100% 换行，视觉上仍是「姓名 / 账号 / 按钮」三排。
       上一版只调 flex-basis（1 1 64px）不解决 → 这里显式改 row，让姓名与账号并排。
     ⚠ 用 flex:1 1 auto 而非 1 1 64px：并排后需要更多空间，否则姓名+账号会被挤着换行。 */
  .user-row-info {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ===== 媒体库顶部工具区（2.1.3-beta14，用户反馈「排版错混、尺寸较大」）=====
   实测（390px 视口）三点问题：
     ① 按钮靠右：.customer-top-actions 带 justify-content:flex-end（约 1260 行），
        在标题左对齐的同一块里形成「左标题 + 右按钮」，看着像同一行两头、很散 → 窄屏改左对齐。
     ② 底边不齐：.sub-tabs 自带 border-bottom + padding-bottom:8px（约 2072 行，为「字段管理」
        的标签页设计），搬到顶部工具区后「图片 / 文件」比「上传」高出约 9px 且带一条悬空横线
        → 这是「排版错混」的直观来源，媒体库内去掉。
     ③ 尺寸不一：.sub-tab 8px 16px(≈36px) 与 .btn-primary 固定 40px 不同高 → 统一到约 33px。
   ⚠ 用 #mediaView 前缀提升特异性：文件后段约 5370 行还有一条全局 .section-header（align-items:center），
     769–900 区间不落在 ≤768 块里，会把标题改成居中。 */
@media (max-width: 900px) {
  #mediaView .section-header { align-items: flex-start; }
  #mediaView .customer-top-actions { justify-content: flex-start; align-items: center; }
  #mediaView .sub-tabs { border-bottom: none; padding-bottom: 0; }
  /* 2.1.3-beta42：高度已由基础规则固定为 32px（line-height 30px），这里再给 6px 上下内边距
     会把内容盒压到 20px、行盒 30px → 文字溢出约 10px。窄屏只调左右内边距与字号。 */
  #mediaView .sub-tab { padding: 0 12px; font-size: 13px; }
  #mediaView .btn-primary { height: 33px; padding: 0 16px; font-size: 13px; border-radius: 16px; }
}

/* ===== 大屏限宽（2.1.3-beta12，docs/UI优化待办.md #7）=====
  原全站无内容容器限宽：1920 / 2560 下表格与表单被拉到通栏，行过长、视线跨度大，
  而弹窗仍是 480px 居中，比例失衡。≥1600 时把内容区限到 1440px 居中。
  ⚠ 必须排除 body.printing-report：打印时 .content-area 被强制 padding:0，
    A4 纸张宽度由 .report-paper 自己决定，限宽会破坏打印排版。
  ⚠ 只限 .content-area，不动 .sidebar / .toolbar（它们通栏是对的）。
  ⚠⚠ 必须带 width:100%（2.1.3-beta16 修复）：.content-area 是 .main-area（flex column）的
    flex item，**flex 布局里 auto margin 会优先吸收全部剩余空间**，使该 item 不再 stretch 撑满，
    宽度退化为 fit-content（＝内容自然宽度）。实测 2560 视口下 .content-area 只有 582px
    （正常应 1440px），整页挤成中间一条、两侧各留白 845px，模块双栏被压成 264px + 242px。
    加 width:100% 后先撑满父容器，再由 max-width 收口、margin auto 居中 → 实测 1920/2560/3440
    三种宽度下均为 1440px 且左右留白相等。 */
@media (min-width: 1600px) {
  body:not(.printing-report) .content-area {
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===== 客户列表：中等宽度「列优先级」（2.1.3-beta12，docs/UI优化待办.md #9）=====
   原 .customer-table{min-width:760px}（约 4499 行）→ 1024 窗口或分屏时整表横向滚动。
   难点：列由 getVisibleColumns() 动态生成（16 列可选、用户可自选），**nth-child 会随列配置
   错位** → 故由 customer.js 给 th / td 打上稳定的 data-col，这里按列名隐藏次要列。
   取舍：宽度不足时先舍弃「详情类」列（公司/行业/来源/地址，进详情弹窗仍可看），
   保留 客户名称 / 状态 / 负责人 / 电话 / 最近跟进 等主信息；再窄才收 邮箱/参与人/注册时间。
   ⚠ 新增列时记得在这里同步分级，否则新列永远不会被收起。 */
@media (min-width: 901px) and (max-width: 1280px) {
  .customer-table { min-width: 680px; }
  .customer-table [data-col="company"],
  .customer-table [data-col="industry"],
  .customer-table [data-col="source"],
  .customer-table [data-col="address"] { display: none; }
}
@media (min-width: 901px) and (max-width: 1120px) {
  .customer-table [data-col="email"],
  .customer-table [data-col="participants"],
  .customer-table [data-col="createdAt"] { display: none; }
}

/* ===== 手机端表单弹窗改底部抽屉（2.1.3-beta12，docs/UI优化待办.md #4）=====
   .modal 原为居中弹窗（width:480px / max-width:90vw / max-height:90vh，约 1696 行）：
   手机上顶部按钮够不到、键盘弹起后可视区更小。项目已有底部抽屉范式 .mobile-more-sheet
   （约 5598 行，圆角 + 安全区 + sheetUp 动画），这里复用同一套观感：
   遮罩改为底部对齐 + 弹窗全宽贴底 + 上滑入场（沿用 .modal 已有的 transform 过渡）。
   ⚠ 断点取 640px：平板（≥641）仍用居中弹窗，避免大屏贴底显得失衡。
   ⚠ 必须同时覆盖 .modal-overlay.show .modal（原为 scale(1)），否则入场动画变成缩放。
   ⚠ .modal-lg(640px) / .modal-sm(400px) 的 width 与本规则同特异性，本规则在文件末尾故胜出。 */
@media (max-width: 640px) {
  .modal-overlay { align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: 100%;
    /* vh 先写、dvh 后写：不支持 dvh 的浏览器忽略第二条，自动回退。
       用 dvh 是因为 iOS Safari 弹出软键盘时 vh 不缩，底部按钮会被键盘盖住。 */
    max-height: 85vh;
    max-height: 85dvh;
    border-radius: 16px 16px 0 0;
    /* .modal 自身无 padding（由 header/body/footer 各自控制），这里只补安全区，
       避免手势条盖住底部按钮。 */
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
  }
  .modal-overlay.show .modal { transform: translateY(0); }
}

/* ===== 平板区间 768–900px（2.1.3-beta12，docs/UI优化待办.md #6）=====
   原 ≤900 一律按手机处理：侧栏收成 64px 图标条 + 常驻 mobile-bottom-nav(56px)，
   768 / 800 宽的平板竖屏（iPad mini、Android 平板）被当成手机，上下两条固定栏吃掉约 108px。
   本块只覆盖 768–900：
     · 隐藏底部导航 —— 侧栏常驻可导航，底栏纯占高度
     · 侧栏 64 → 88px 并恢复文字（竖排：图标上、文字下；88px 放不下横向「图标 + 4 字」）
     · 底部让位还原为常规 24px
   ⚠ 上界取 900 而非 1024：901–1024 侧栏已是完整宽度（beta11 的 clamp）、底栏也已隐藏
     （约 5743 行 @media(min-width:901px)），若在这里再压成 88px 反而是退步。
   ⚠ 下界取 769 而非 768：≤768 块把 .sidebar 改成了「抽屉」模式（position:fixed +
     translateX(-100%)，点 ☰ 打开，宽度 220px，约 5532 行）。若把 768 也纳入本块，
     只会把抽屉压成 88px 且仍是隐藏态 → 比原状更差。故避开 768 这一点：
     768 及以下维持原有手机模式（抽屉 + 底栏 + 底部让位，三者都完整），769–900 才走平板布局。
   ⚠ 附带修复：769–900px 区间此前「有底栏、却没有底部让位」（padding-bottom 只写在 ≤768 块
     约 5552 行），底部内容被底栏压住一截；隐藏底栏后此问题消失。 */
@media (min-width: 769px) and (max-width: 900px) {
  .mobile-bottom-nav { display: none !important; }
  /* 隐藏 ☰：本区间侧栏常驻可见，抽屉按钮无意义。
     更重要的是 `body.sidebar-open .sidebar-mask`（约 6561 行）**不在窄屏块内**——
     任何宽度点 ☰ 都会加 body.sidebar-open → 弹出全屏遮罩；本区间侧栏本来就在，
     点了只会挡住页面且看起来像卡死。 */
  .mobile-hamburger { display: none; }
  .sidebar { width: 88px; padding: 16px 6px; }
  .logo-text, .nav-label { display: block; text-align: center; font-size: 12px; }
  .nav-item { flex-direction: column; gap: 4px; height: auto; padding: 8px 4px; justify-content: center; }
  .nav-item span { display: block; font-size: 12px; text-align: center; line-height: 1.25; }
  .profile-section { justify-content: center; }
  .content-area { padding-bottom: 24px; }
}

/* ===== 2.1.3-beta32：工作记录多人参与 + 协作进展流 =====
   构成：① 表单里的「参与人」chips + 添加下拉 ② 历史左栏的四视图 chips
        ③ 记录列表里的参与人标签 ④ 弹窗底部的协作进展流（append-only 时间线）。 */
.form-hint-inline {
  font-size: 11px; font-weight: 400; color: var(--text-tertiary); margin-left: 4px;
}
.entry-part-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 34px; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--white);
}
.entry-part-empty { font-size: 12px; color: var(--text-tertiary); }
.entry-part-chip {
  display: inline-flex; align-items: center; gap: 2px;
  height: 24px; padding: 0 4px 0 10px; border-radius: 12px;
  background: rgba(26, 115, 232, 0.10); color: var(--blue, #1a73e8);
  font-size: 12px; line-height: 24px;
}
.entry-part-chip-x {
  border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 4px;
}
.entry-part-chip-x:hover { color: var(--error, #d93025); }
/* 2.1.3-beta33：chips 与「＋ 添加」合并成一行，省掉单独占行的空框 */
.entry-part-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-part-row .entry-part-chips { flex: 1 1 260px; min-width: 0; }
.entry-part-add { margin-top: 0; width: auto; flex: 0 0 auto; max-width: 100%; }

/* 记录列表里的参与人标签（周视图 / 历史左栏） */
.entry-participants {
  font-size: 11px; color: var(--text-tertiary);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 历史左栏四视图 chips */
.entry-view-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 8px; }
.entry-view-chip {
  border: none; background: var(--bg); color: var(--text-secondary);
  font-size: 12px; padding: 5px 10px; border-radius: 12px; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.entry-view-chip:hover { background: rgba(0, 0, 0, 0.06); }
.entry-view-chip.is-active { background: var(--blue, #1a73e8); color: #fff; }

/* ===== 2.1.3-beta33：工作记录弹窗加宽 + 页签 =====
   480px 放不下「记录人/负责人/参与人/日期/时间/标题/描述/分类/项目/客户/产品」，
   加宽到 760px（窄屏仍受 .modal 的 max-width:90vw 与 ≤640 抽屉规则约束）。 */
/* 2.1.3-beta34：固定高度，两个页签共用同一个窗口尺寸。
   原来高度由内容撑开，「记录内容」和「协作进展」高度不同 → 切页签时弹窗会跳一下。
   固定后：正文超出时在表单区内滚动，进展面板填满剩余空间，视觉上窗口纹丝不动。 */
.modal-entry { width: 760px; height: min(88vh, 820px); max-height: min(88vh, 820px); }
/* 加宽后字段要跟着伸展：.form-field 默认固定 200px，760px 下每行会剩一大片空白。
   flex-basis 会让 .form-field-full 也变成 200 宽，故单独把整行字段钉回 100%。 */
.modal-entry .form-field { width: auto; flex: 1 1 200px; }
.modal-entry .form-field-full { width: 100%; flex: 1 1 100%; }
/* 2.1.3-beta35：内容描述固定 3 行（约 3×20 + 内边距 + 边框），超出在框内滚动，
   不再用默认的 min-height:132px 把弹窗撑高、也不想让它随内容长高。 */
#entryDescription {
  min-height: 0; height: 82px; max-height: 82px;
  overflow-y: auto; resize: none;
}

.entry-tabs {
  display: flex; gap: 4px; flex-shrink: 0;
  padding: 0 24px; border-bottom: 1px solid var(--border, #e3e6ea);
  background: var(--white, #fff);
}
.entry-tab {
  border: none; background: transparent; cursor: pointer;
  padding: 10px 12px; font-size: 13px; line-height: 20px;
  color: var(--text-secondary, #5f6368);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .15s var(--ease);
}
.entry-tab:hover:not(:disabled) { color: var(--text-primary, #202124); }
.entry-tab.is-active { color: var(--blue, #1a73e8); border-bottom-color: var(--blue, #1a73e8); font-weight: 500; }
.entry-tab:disabled { color: var(--text-tertiary, #9aa0a6); cursor: not-allowed; }
.entry-tab-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: rgba(26, 115, 232, .12); color: var(--blue, #1a73e8);
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}

/* 页签面板：表单面板沿用 .modal-body（自身滚动）；进展面板同样独占剩余高度 */
.entry-tab-panel[hidden] { display: none !important; }
.entry-updates-panel {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  /* 2.1.3-beta35：固定高度后这块会很大，灰底在只有一两条时显得空旷 → 改白底 */
  background: var(--white, #fff); overflow: hidden;
}
.entry-updates-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 24px 8px; }
.entry-updates-empty { font-size: 12px; color: var(--text-tertiary); padding: 10px 0; }
.entry-update-row { padding: 10px 0; border-bottom: 1px solid var(--hairline, #eceff1); }
.entry-update-row:last-child { border-bottom: none; }
.entry-update-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-tertiary); }
.entry-update-avatar {
  width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #5f6368; color: #fff; font-size: 10px;
}
.entry-update-avatar img { width: 100%; height: 100%; object-fit: cover; }
.entry-update-name { color: var(--text-primary); font-weight: 500; }
.entry-update-time { font-size: 11px; }
.entry-update-del {
  margin-left: auto; border: none; background: transparent;
  color: var(--text-tertiary); font-size: 12px; cursor: pointer; padding: 0 2px;
}
.entry-update-del:hover { color: var(--error, #d93025); }
.entry-update-content {
  font-size: 13px; color: var(--text-primary); line-height: 1.65; margin-top: 4px;
  overflow-wrap: anywhere;
}
.entry-update-att { margin-top: 6px; }
/* 输入区固定在面板底部 */
.entry-update-add {
  flex-shrink: 0; padding: 10px 24px 12px;
  border-top: 1px solid var(--hairline, #eceff1); background: var(--white, #fff);
}
/* 输入区最多 3 行，超出内部滚动（与「内容描述」同口径） */
.entry-update-add textarea {
  width: 100%; min-height: 64px; height: 64px; max-height: 64px;
  overflow-y: auto; resize: none;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 14px; line-height: 1.5;
  color: var(--text-primary); background: var(--white, #fff);
  transition: border-color 0.15s var(--ease);
}
.entry-update-add textarea:focus { border-color: var(--blue); }
.entry-update-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.entry-update-bar .entry-update-attach { flex: 1 1 240px; min-width: 0; }
/* ⚠ .btn-sm 的**唯一权威定义**。它必须待在 .btn-primary/.btn-secondary 之后：
   「+ 新增」这类按钮同时带 .btn-primary.btn-sm，两者特异性相同 (0,1,0)，
   靠这里后置才能把 40px 收到 30px。要改小按钮尺寸只改这一处。
   （文件中部原有两条 padding/font-size 定义，被本条完全覆盖、属死代码，已于 2.1.4-beta8 删除。）
   border-radius 写 15px 但**实际不生效**：theme-pro.css 的 .btn-sm 在本文件之后加载、
   把圆角改成 var(--radius-sm)。保留是为 theme-pro 去掉该规则时兜底，别指望改它有效果。 */
.btn-sm { height: 30px; padding: 0 14px; font-size: 13px; border-radius: 15px; }

/* 紧凑附件（一行「＋ 附件」+ chips）——工作记录「协作进展」、客户跟进（新增/编辑）、项目跟进（新增/编辑）共用。
   createAttachEditor 的双栏分支（.fu-att）目前无调用点，保留作将来宽表单需要并排选图/选文件的兼容路径。 */
.fu-att-compact { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fu-att-add {
  height: 30px; padding: 0 12px; border-radius: 15px; cursor: pointer;
  border: 1px dashed var(--border, #dadce0); background: var(--white, #fff);
  color: var(--text-secondary, #5f6368); font-size: 12px;
}
.fu-att-add:hover:not(:disabled) { border-color: var(--blue, #1a73e8); color: var(--blue, #1a73e8); }
.fu-att-add:disabled { opacity: .5; cursor: not-allowed; }
.fu-att-compact .fu-att-count { font-size: 11px; color: var(--text-tertiary, #9aa0a6); }
.fu-att-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fu-chip {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 22px 0 6px; border-radius: 15px;
  background: var(--surface-2, #f1f3f4); border: 1px solid var(--border, #e3e6ea);
  font-size: 12px; max-width: 180px;
}
.fu-chip-img { padding: 0 22px 0 0; overflow: hidden; }
.fu-chip-img .fu-att-thumb { width: 30px; height: 30px; object-fit: cover; border-radius: 15px 0 0 15px; display: block; }
.fu-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-chip .fu-att-del {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; line-height: 14px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px;
  cursor: pointer; padding: 0;
}
.fu-chip .fu-att-del:hover { background: var(--error, #d93025); }

/* 历史视图内联编辑（宽度随右栏）：页签与面板同样可用，只限制面板最大高度 */
.inline-modal-host .modal-entry { height: auto; max-height: none; min-height: 480px; }
.inline-modal-host .entry-tabs { padding: 0; }
.inline-modal-host .entry-updates-panel { max-height: 60vh; }
.inline-modal-host .entry-updates-list { padding: 10px 0 4px; }
.inline-modal-host .entry-update-add { padding: 10px 0 0; }

/* 窄屏：底部抽屉里给页签与输入区留足高度 */
@media (max-width: 640px) {
  .modal-entry { width: 100%; height: 85vh; height: 85dvh; max-height: 85vh; max-height: 85dvh; }
  .entry-tabs { padding: 0 16px; }
  .entry-tab { padding: 10px 8px; }
  .entry-updates-list { padding: 10px 16px 4px; }
  .entry-update-add { padding: 10px 16px 12px; }
  .entry-part-add { font-size: 14px; }
}

/* ===== 云存储设置（设置页 · 仅 super_admin）=====
   全新类名，不复用 .user-filter / .sub-tab 等公共类，避免影响其它模块 */
.storage-status-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
/* flex item 默认 min-width:auto，长句说明在窄屏会撑出卡片而不是换行 */
.storage-status-row .perm-hint { min-width: 0; flex: 1 1 240px; }
.storage-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.storage-badge.is-off { background: rgba(0, 0, 0, .06); color: var(--text-secondary, #667085); }
.storage-badge.is-on { background: var(--success-light, #e7f6ec); color: var(--success, #1f9d55); }
.storage-form { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 14px; align-items: center; max-width: 760px; }
/* 标签不折行：AccessKey Secret 在 150px 列里会断成两行，与其它行基线不齐 */
.storage-form .personal-info-label { white-space: nowrap; }
/* 输入框必须自带边框与留白：全局 reset 清空了 input 的 border/background，
   只设 height/width 时填内容的区域与普通文本无异，看不出哪里可以输入。 */
.storage-form input {
  height: 38px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border-color, #d0d5dd);
  border-radius: 8px;
  background: var(--bg-input, #fff);
  color: var(--text-primary, #202124);
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.storage-form input::placeholder { color: var(--text-tertiary, #9aa0a6); }
.storage-form input:focus {
  border-color: var(--blue, #1a73e8);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}
.storage-key-hint { margin-top: 8px; }
/* 开关卡片：标题 + 一句「它到底管什么」，取代原先只有标签的一行勾选 */
.storage-switches { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.storage-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #d0d5dd);
  border-radius: 8px;
  background: var(--surface, #fff);
  cursor: pointer;
  transition: border-color .15s ease;
}
.storage-switch:hover { border-color: var(--blue, #1a73e8); }
.storage-switch input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--blue, #1a73e8); cursor: pointer; }
.storage-switch-text { display: flex; flex-direction: column; gap: 3px; }
.storage-switch-title { font-size: 14px; font-weight: 500; color: var(--text-primary, #202124); }
.storage-switch-desc { font-size: 12px; line-height: 1.5; color: var(--text-secondary, #5f6368); }
.storage-usage { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 8px; }
.storage-usage .usage-item { display: flex; flex-direction: column; gap: 2px; min-width: 88px; }
.storage-usage .usage-num { font-size: 20px; font-weight: 600; line-height: 1.2; }

@media (max-width: 760px) {
  .storage-form { grid-template-columns: 1fr; gap: 6px; }
  .storage-form .personal-info-label { margin-top: 6px; }
  .storage-usage { gap: 16px 18px; }
  /* 88px 的最小宽度 × 4 项在手机宽度下放不进一行，会把卡片撑出视口 */
  .storage-usage .usage-item { min-width: 68px; }
}

/* ===== 2.1.4-beta8：客户列表页头窄屏收口 =====
   实测 390×844：改前页头操作区占 3 行，主操作「新增客户」被挤到第二行最左，
   加上筛选栏 3 行，内容区被推到 400px 以下。改为两列网格：搜索框跨整行、
   四个按钮 2×2，主操作落右下。
   ⚠ 必须放在文件末尾：文件中部已有同特异性的窄屏规则
     （#customerView .customer-top-actions 的 justify-content、
       #customerView .customer-top-actions > #custSearch 的 flex），
     只有后置才能覆盖，写在前面等于没写。
   ⚠ 只作用 #customerView：媒体库等模块也在用 .customer-top-actions，
     写成全局选择器会把它们的页头一起变网格。
   ⚠ 断点取 600 而非 768：601~768 宽度下五个控件仍能排一行（实测 768 一行总宽约 390px），
     用网格会把按钮拉成全宽两列、显得又胖又空；搜索框独占一行的需求在更宽断点里
     已由 #custSearch 的 flex:1 1 100% 处理，不需要网格代劳。 */
@media (max-width: 600px) {
  #customerView .customer-top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    justify-content: stretch;
  }
  /* 搜索框独占一行 */
  #customerView .customer-top-actions > #custSearch {
    grid-column: 1 / -1;
    width: 100%;
  }
  #customerView .customer-top-actions > .col-chooser-wrap,
  #customerView .customer-top-actions > .btn-secondary,
  #customerView .customer-top-actions > .btn-primary,
  #customerView .customer-top-actions > .btn-accent {
    width: 100%;
  }
  #customerView .customer-top-actions > .col-chooser-wrap > .btn-secondary {
    width: 100%;
  }
  /* 次级筛选（标签 / 列设置 / 行高）只在窄屏折叠，768~1400 保持可见。
     不复用 .cust-filter-more：那个类在 <1400px 全宽度生效，会把 PC 端也藏起来。
     展开仍走「更多筛选」按钮的 #custFilterBar.expanded（JS 已有）。 */
  #customerView .customer-filter-bar .cust-filter-narrow { display: none; }
  #customerView .customer-filter-bar.expanded .cust-filter-narrow { display: inline-block; }
}

