/* ==========================================================================
   售后管理系统 - 全局样式
   版本: v18（方案A · 现代 SaaS 数据密集型，对齐 ui_v1 Design Tokens）
   设计规范: 纯 HTML+CSS，无外部依赖；仅重写样式，保留全部既有功能类名
   变更要点: 更细表格密度 / 筛选区折叠 / 状态彩色标签 / 紧凑统计卡 /
             侧栏 logo+avatar 增强 / 弹窗与按钮细节对齐方案A /
             弹窗输入控件统一（无 type 输入框补齐 4px 圆角与边框）/ 弹窗右侧圆角补齐
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens（:root CSS 变量）
   -------------------------------------------------------------------------- */
:root {
  /* 色彩 */
  --bg: #f5f7fa;                 /* 页面背景（ui_v1） */
  --surface: #ffffff;            /* 卡片/侧边栏表面 */
  --primary: #2563eb;            /* 主色 */
  --primary-hover: #1d4ed8;      /* 主色悬停 */
  --primary-light: #eff6ff;      /* 主色浅底（active / tag-info） */
  --primary-ring: rgba(37, 99, 235, 0.12);
  --text-main: #1f2937;          /* 主文本（ui_v1） */
  --text-muted: #6b7280;         /* 次要文本/占位（ui_v1） */
  --border: #e5e7eb;             /* 边框（ui_v1） */
  --bg-subtle: #f9fafb;          /* 浅灰底（表头/悬停/按钮hover） */

  /* 状态色（浅底深字 pill，对齐 ui_v1） */
  --tag-danger-bg: #fee2e2;   --tag-danger-text: #b91c1c;
  --tag-normal-bg: #f1f5f9;   --tag-normal-text: #475569;
  --tag-warning-bg: #ffedd5;  --tag-warning-text: #c2410c;
  --tag-info-bg: #dbeafe;     --tag-info-text: #1d4ed8;
  --tag-success-bg: #dcfce7;  --tag-success-text: #15803d;

  /* 工单状态 pill（对齐 ui_v1） */
  --pill-created-bg: #fef3c7; --pill-created-t: #b45309;
  --pill-received-bg: #ffedd5; --pill-received-t: #c2410c;
  --pill-repairing-bg: #dbeafe; --pill-repairing-t: #1d4ed8;
  --pill-closed-bg: #dcfce7; --pill-closed-t: #15803d;
  --pill-cancelled-bg: #f1f5f9; --pill-cancelled-t: #475569;

  /* 跟进状态 pill */
  --pill-follow-pending-bg: #ede9fe; --pill-follow-pending-t: #6d28d9;
  --pill-follow-processing-bg: #ffedd5; --pill-follow-processing-t: #c2410c;
  --pill-follow-done-bg: #dcfce7; --pill-follow-done-t: #15803d;

  /* 排版 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
          "Microsoft YaHei", Helvetica, Arial, sans-serif;
  --font-size: 13px;             /* 数据密集型：正文 13px */
  --font-size-lg: 18px;          /* 标题/Logo */
  --font-size-sm: 12px;          /* 标签/辅助 */
  --font-weight-medium: 600;

  /* 布局 */
  --sidebar-w: 240px;
  --content-pad: 28px;
  --card-pad: 18px;

  /* 圆角 */
  --radius: 10px;                /* 卡片（ui_v1） */
  --radius-sm: 8px;              /* 按钮/输入框/导航项 */
  --radius-xs: 6px;              /* 小控件/表格操作按钮 */

  /* 阴影 */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-modal: 0 20px 60px rgba(15, 23, 42, 0.25);

  /* 焦点环 */
  --focus-ring: 0 0 0 3px var(--primary-ring);
}

/* --------------------------------------------------------------------------
   2. Reset / 基础
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: 1.5;
  color: var(--text-main);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 700; color: var(--text-main); }
h1 { font-size: var(--font-size-lg); }
h2 { font-size: 16px; margin-bottom: 14px; }
h3 { font-size: 14px; margin-bottom: 10px; }

hr { border: none; border-top: 1px solid var(--border); }

input:not([type]), input[type="text"], input[type="password"], input[type="number"],
input[type="date"], select, .cs-trigger, textarea {
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   3. 布局：240px 侧边栏 + 主内容（Flex）
   -------------------------------------------------------------------------- */
.app-body { background: var(--bg); }

.layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

/* 侧边栏（方案A：白底、圆角导航、logo 与头像增强） */
.topnav {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
}

/* Logo：渐变圆角方块 + 品牌名 */
.topnav .brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-main);
  padding: 4px 6px 16px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.topnav .brand::before {
  content: "售";
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topnav .brand .ver {
  flex: 1 1 100%;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 0;
  margin-top: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* DEV 开发环境角标：固定右下角，登录前后所有页面都可见 */
.dev-float {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 9999;
  padding: 4px 11px;
  border-radius: 7px;
  background: #fef3c7;
  color: #b45309;
  border: 1.5px solid #fcd34d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.18);
  pointer-events: none;
  user-select: none;
}

/* 导航项：紧凑 13px + 左侧指示条 */
.topnav a {
  position: relative;
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.topnav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
}
.topnav a:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}
.topnav a:hover::before { background: var(--border); }
.topnav a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.topnav a.active::before { background: rgba(255,255,255,0.9); }

/* 用户信息：头像 + 名称，推到底部 */
.topnav .user {
  margin-top: auto;
  padding: 12px 10px 6px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
}
.topnav .user-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  overflow: visible;
}
.topnav .user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.topnav .user + a { margin-top: 2px; }

/* 主内容区 */
.container {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--content-pad);
}

/* 访客（登录页）主区 */
.guest-body .container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

/* --------------------------------------------------------------------------
   4. Flash 消息
   -------------------------------------------------------------------------- */
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  margin-bottom: 16px;
  font-size: var(--font-size);
}
.flash-ok    { background: var(--tag-success-bg); color: var(--tag-success-text); }
.flash-error { background: var(--tag-danger-bg);  color: var(--tag-danger-text); }
.flash-warn  { background: var(--tag-warning-bg); color: var(--tag-warning-text); }

/* --------------------------------------------------------------------------
   5. 卡片
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--card-pad);
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 { margin-bottom: 0; }
.card-head .btn { vertical-align: middle; }

.card.narrow-card { max-width: 640px; margin-left: 0; }
.card.narrow-card.sm { max-width: 460px; }

/* --------------------------------------------------------------------------
   6. 表格（数据密集型：细密度 + 容器边框圆角）
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* v1.10.3 列表页表头滚动固定：滚动发生在表格容器内部，thead 的 sticky 才能贴顶。
   限高 = 视口高度 - 页头/筛选区约占高度；行多时出容器内滚动条，表头与右侧固定列始终可见 */
.table-wrap.sticky-head {
  max-height: calc(100vh - 250px);
  min-height: 320px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}
thead th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  /* 与 .tag/.badge 的固定高度(22px)一致，保证标签与纯文字单元格同一行内居中对齐 */
  line-height: 22px;
  white-space: nowrap;
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--bg-subtle); }
tbody tr:last-child td { border-bottom: none; }

/* 表格内操作按钮/文字链接 */
td .btn,
.row-actions .btn {
  white-space: nowrap;
}
td a:not(.btn) { color: var(--primary); text-decoration: none; }
td a:not(.btn):hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   7. 按钮（紧凑，对齐 ui_v1）
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  vertical-align: middle;
  white-space: nowrap;
}
.btn:hover {
  border-color: #cbd5e1;
  background: var(--bg-subtle);
  color: var(--text-main);
  text-decoration: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-danger {
  background: var(--surface);
  border-color: #fecaca;
  color: var(--tag-danger-text);
}
.btn-danger:hover {
  border-color: var(--tag-danger-text);
  color: var(--tag-danger-text);
  background: var(--tag-danger-bg);
}

.btn-outline { background: var(--surface); }

.btn-sm { padding: 4px 8px; font-size: 12px; border-radius: var(--radius-xs); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* 工具栏（新建/导出等） */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar .btn { white-space: nowrap; }

/* --------------------------------------------------------------------------
   8. 表单
   -------------------------------------------------------------------------- */
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}

input:not([type]), input[type="text"], input[type="password"], input[type="number"],
input[type="date"], select, .cs-trigger, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* 弹窗内输入控件统一风格：圆角 4px（与多数控件一致，覆盖全局 radius-sm=8px） */
.modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.modal select,
.modal .cs-trigger,
.modal textarea {
  border-radius: 4px;
}
textarea { min-height: 70px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9ca3af; }

input:focus, select:focus, .cs-trigger:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.input { width: auto; display: inline-block; }
.input-sm { padding: 5px 10px; font-size: 13px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.form-grid.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

.form-item { margin-bottom: 12px; }
.form-item label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}
.form-item .req { color: var(--tag-danger-text); margin-left: 2px; }

.form-section { margin-bottom: 20px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.section-head h3 { margin-bottom: 0; }
.section-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag-info-bg);
  color: var(--tag-info-text);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.hint-text { color: var(--text-muted); font-size: 12px; margin-bottom: 12px; }

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}
.check-pills label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.check-pills label:hover { border-color: var(--primary); color: var(--primary); }
.check-pills input { accent-color: var(--primary); }

/* 筛选区（方案A：可折叠） */
.filter-zone { margin-bottom: 14px; }
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 8px;
}
.filter-toggle:hover { border-color: var(--primary); color: var(--primary); }
.filter-toggle .ft-arrow { display: inline-block; transition: transform 0.15s ease; font-size: 11px; }
.filter-zone.collapsed .filter-toggle .ft-arrow { transform: rotate(-90deg); }
.filter-zone.collapsed .filter-bar { display: none; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.filter-bar select, .filter-bar input, .filter-bar .btn, .filter-bar .cs-trigger {
  width: auto;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
}
/* 筛选栏单行排布：搜索框与下拉统一限宽，长选项省略号截断 */
.filter-bar input[name="keyword"] { width: 118px; }
.filter-bar select,
.filter-bar .cs-wrap {
  max-width: 112px;
  text-overflow: ellipsis;
  padding-right: 6px;
}
.filter-bar .cs-wrap { width: auto; display: inline-block; padding-right: 0; }
.filter-bar select[name="contact_status"],
.filter-bar .cs-wrap[data-name="contact_status"] { max-width: 138px; }
.filter-bar .dp-range { min-width: 132px; padding: 7px 8px; gap: 6px; }
.filter-bar .btn { cursor: pointer; padding: 7px 9px; white-space: nowrap; }
.filter-bar .btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-bar .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* --------------------------------------------------------------------------
   9. 状态标签 Tag / Badge（方案A：彩色 pill）
   -------------------------------------------------------------------------- */
.tag, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* 固定高度 + 统一内边距：无论有无边框，所有标签尺寸完全一致，
     与同列纯文字单元格在同一行内视觉居中对齐（v1.7.0 对齐修复） */
  height: 22px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  vertical-align: middle;
  white-space: nowrap;
}
.tag-muted { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
/* 紧急度 urgency */
.tag-urgent{ background: var(--tag-danger-bg);  color: var(--tag-danger-text); }
.tag-attention{ background: var(--tag-warning-bg); color: var(--tag-warning-text); }
.tag-normal                 { background: var(--tag-normal-bg);  color: var(--tag-normal-text); }

/* 工单类型 */
.tag-repair  { background: #f0f9ff; color: #075985; }
.tag-consult { background: #f0fdf4; color: #166534; }

/* 工单状态 status（badge-*，彩色 pill 对齐 ui_v1） */
.badge-created  { background: var(--pill-created-bg);   color: var(--pill-created-t); }
.badge-received { background: var(--pill-received-bg);  color: var(--pill-received-t); }
.badge-repairing{ background: var(--pill-repairing-bg); color: var(--pill-repairing-t); }
.badge-closed   { background: var(--pill-closed-bg);    color: var(--pill-closed-t); }
.badge-cancelled{ background: var(--pill-cancelled-bg); color: var(--pill-cancelled-t); }

.empty-tip { text-align: center; color: var(--text-muted); padding: 32px 0; }
.empty-muted { color: var(--text-muted); }

.hint-line { color: var(--text-muted); font-size: 12px; margin-top: 10px; }

/* --------------------------------------------------------------------------
   11. 分页
   -------------------------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
}
.pager .btn { padding: 4px 10px; }
.pager span { color: var(--text-muted); font-size: 13px; }

/* --------------------------------------------------------------------------
   12. 详情页
   -------------------------------------------------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}
.detail-grid .item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.detail-grid .item b {
  display: block;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 2px;
}
.detail-grid .item.full { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   13. 登录页（方案A：居中卡片 + 渐变点缀）
   -------------------------------------------------------------------------- */
.login-wrap {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-wrap h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.login-wrap h1::before {
  content: "售";
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
  text-align: left;
}

/* --------------------------------------------------------------------------
   14. 统计报表（方案A：紧凑统计卡）
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.stat .lbl { font-size: 12px; color: var(--text-muted); }
.stat .num { font-size: 24px; font-weight: 700; color: var(--primary); margin-top: 2px; }
.stat .d { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.add-box {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   15. 工单列表：勾选/行编辑/最近跟进/弹窗/批量补录/列设置
   -------------------------------------------------------------------------- */
.col-check { width: 40px; text-align: center; }
#ticket-table input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* 行内编辑（双击编辑） */
tr.editing td { background: var(--primary-light); }
td.cell-edit { padding: 4px 8px; }
td.cell-edit select, td.cell-edit input, td.cell-edit .cs-trigger {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-xs);
  box-shadow: var(--focus-ring);
}
td.cell-edit .cs-wrap { display: inline-block; width: auto; vertical-align: middle; }
td.cell-changed { background: var(--tag-warning-bg); }

/* 最近跟进列 */
.follow-cell { min-width: 140px; }
.follow-text {
  color: var(--text-main);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.follow-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

/* 行操作区 */
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 6px; }
.row-actions .btn:last-child { margin-right: 0; }
.btn-sm.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-sm.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

/* --------------------------------------------------------------------------
   16. 弹窗 Modal（方案A：圆角 14px + 深投影）
   -------------------------------------------------------------------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 48px 16px;
  overflow-y: auto;
}
.modal {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  max-height: 88vh;
  overflow: auto;
}
.modal::-webkit-scrollbar { width: 8px; }
.modal::-webkit-scrollbar-thumb { background: rgba(107, 114, 128, 0.35); border-radius: 8px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1180px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}
.modal-head h3 { margin-bottom: 0; font-size: 16px; }
.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}
.modal-close:hover { color: var(--text-main); background: var(--bg-subtle); }

.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

/* 批量补录 */
.batch-tip {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  margin-bottom: 10px;
}
.mini-table { font-size: 12px; }
.mini-table th { padding: 8px 12px; }
.mini-table td { padding: 8px 12px; }

.btn-save { min-width: 96px; }

/* --------------------------------------------------------------------------
   17. 看板（保留表格分组结构，视觉强化为卡片感）
   -------------------------------------------------------------------------- */
.board-table { font-size: 13px; }
.board-table th { padding: 9px 12px; }
.board-table td { padding: 10px 12px; }
.cell-problem {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-problem-desc {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #555;
}

/* 字典管理 */
.dict-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.add-box .input { flex: 1 1 200px; }

/* --------------------------------------------------------------------------
   18. 错误页
   -------------------------------------------------------------------------- */
.error-code {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.error-msg { color: var(--text-muted); margin-bottom: 20px; }

/* --------------------------------------------------------------------------
   19. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .topnav {
    position: fixed;
    top: 0;
    left: 0;
    width: 264px;
    height: 100vh;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    border-right: 1px solid var(--border);
    border-bottom: none;
    padding: 10px 14px 14px;
    gap: 2px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .topnav.open {
    transform: translateX(0);
    box-shadow: 0 0 28px rgba(15, 23, 42, 0.22);
  }
  .nav-toggle { display: flex; }
  .nav-overlay.show { display: block; }
  .topnav .brand { padding: 6px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
  .topnav a { padding: 10px 12px; font-size: 14px; }
  .topnav .user { margin-top: auto; border-top: 1px solid var(--border); padding: 12px 10px 6px; }
  .container { padding: 68px 14px 16px; }
.form-grid, .form-grid.wide, .detail-grid{ grid-template-columns: 1fr; }
  .detail-grid .item.full { grid-column: auto; }
  .modal { max-width: 100%; }
  /* v22 统计报表卡片：窄屏横排网格，一层最多 4 个，多余自动换行（6 个卡片 => 4+2） */
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 8px 10px; }
  .stat .num { font-size: 18px; margin-top: 1px; }
  .stat .lbl { font-size: 11px; }
  /* 极窄屏放不下 4 列时退化为 2 列横排 */
  @media (max-width: 480px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
}

@media print {
  .topnav { display: none; }
  .layout { display: block; }
  .container { padding: 0; }
  .card { box-shadow: none; border: none; }
}

/* ===== 统计报表图表看板 ===== */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.chart-card.chart-wide { grid-column: 1 / -1; }
.chart-head { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.chart-tag { font-size: 11px; font-weight: 400; color: var(--text-muted); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.chart-box { position: relative; height: 260px; }
.chart-card:not(.chart-wide) .chart-box { height: 220px; }
.chart-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart-duo-item { min-width: 0; }
.chart-empty { padding: 64px 0; text-align: center; color: var(--text-muted); font-size: 13px; }
.chart-detail { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.chart-detail summary { cursor: pointer; font-size: 12px; color: var(--text-muted); user-select: none; }
.chart-detail table { margin-top: 8px; width: 100%; }
.chart-detail th { background: var(--bg-subtle); }
@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-duo { grid-template-columns: 1fr; }
}

/* ---------- 工单批量导入 ---------- */
.import-tip { margin-bottom: 10px; }
.import-tip .hint { margin: 6px 0 0; }
/* v1.10.15 导入说明：结构化分块（橙色必读条 + 可折叠分项 + 取值表） */
.imp-alert {
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 8px; padding: 9px 12px; font-size: 12.5px; line-height: 1.75;
}
.imp-sec { margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.imp-sec > summary {
  cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 600;
  color: var(--text-main); background: var(--bg-subtle); user-select: none;
}
.imp-sec[open] > summary { border-bottom: 1px solid var(--border); }
.imp-body { padding: 10px 12px; font-size: 12.5px; color: var(--text-muted); line-height: 1.8; }
.imp-dl { margin: 0; display: grid; grid-template-columns: 96px 1fr; gap: 2px 10px; }
.imp-dl dt { color: var(--text-main); font-weight: 600; }
.imp-dl dd { margin: 0; }
.imp-body table { width: 100%; border-collapse: collapse; margin: 2px 0; }
.imp-body th, .imp-body td {
  border: 1px solid var(--border); padding: 5px 8px;
  text-align: left; font-size: 12px; vertical-align: top;
}
.imp-body th { background: var(--bg-subtle); color: var(--text-main); font-weight: 600; }
.imp-note { margin-top: 6px; color: var(--text-muted); }
.imp-actions { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-actions span { font-size: 12px; color: var(--text-muted); }
.import-upload { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.import-upload input[type="file"] { flex: 1; }
#import-result { margin-top: 10px; }
.import-summary { padding: 10px 12px; border-radius: var(--radius); background: var(--bg-subtle); font-size: 13px; margin-bottom: 10px; }
.import-summary.import-error { color: var(--tag-danger-text); background: var(--tag-danger-bg); }
.import-ok { color: #16a34a; }
.import-bad { color: var(--tag-danger-text); }
.import-errors-wrap { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.import-errors-wrap .mini-table { margin: 0; }
.sub-title { font-size: 13px; font-weight: 600; color: var(--text-main); margin: 14px 0 8px; }
.muted { color: var(--text-muted); font-size: 12px; }
.empty-muted { color: var(--text-muted); font-size: 13px; padding: 10px 0; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.mcard { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); position: relative; }
.cover-badge { position: absolute; top: 6px; left: 6px; z-index: 2; background: rgba(16, 163, 127, 0.92); color: #fff; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 999px; font-weight: 600; }
.mcard img, .mcard video { width: 100%; height: 140px; object-fit: cover; display: block; background: #f8fafc; }
.mcard .mname { font-size: 12px; color: var(--text-muted); padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; word-break: break-all; }
.file-chip { padding: 40px 8px; text-align: center; color: var(--text-muted); font-size: 12px; background: var(--bg-subtle); }
.kv { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 10px 12px; background: var(--bg-subtle); border-radius: var(--radius); }
.kv span { font-size: 13px; color: var(--text-main); }
.kv span.full { width: 100%; }
.kv b { display: inline-block; min-width: 52px; color: var(--text-muted); font-weight: 500; margin-right: 6px; }
.model-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--surface); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.form-grid label { display: block; font-size: 13px; color: var(--text-main); }
.form-grid input, .form-grid select { width: 100%; margin-top: 4px; }
.form-grid .cs-wrap { width: 100%; margin-top: 4px; }
.form-grid input[type="checkbox"], .form-grid input[type="radio"] { width: auto; margin-top: 0; }
.req { color: #dc2626; }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }
.badge-created { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-received { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-repairing { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-closed { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-cancelled { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ===== v20 左侧分组侧边栏（分组标题强化 + 当前组高亮） ===== */
.nav-groups { padding: 6px 0 10px; }
.nav-group {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 20px 12px 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.5px;
  user-select: none;
}
.nav-group::before {
  content: "";
  flex: 0 0 3px;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--primary);
}
.nav-group:first-child { margin-top: 10px; padding-top: 0; border-top: none; }
.nav-group.active-group { color: var(--primary); font-weight: 800; }

/* ===== v20 移动端抽屉式侧边栏（汉堡按钮 + 遮罩） ===== */
.nav-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}
.nav-toggle svg { width: 20px; height: 20px; }
/* 修复：基础样式(.nav-toggle{display:none})位于首个媒体查询之后，同特异性下后定义覆盖了窄屏的 flex，
   故在基础样式后再次声明窄屏显示，保证 max-width:900px 下汉堡按钮可见 */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 999;
}

/* ===== v19 产品列表卡片 ===== */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-top: 16px; }
.pcard {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.pcard:hover { box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08); transform: translateY(-2px); border-color: #c7d7f5; }
.pcard .pcover { height: 150px; background: #f8fafc; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pcard .pcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .pcover .pcover-ph { color: var(--text-muted); font-size: 16px; font-weight: 600; letter-spacing: 0.5px; max-width: 88%; word-break: break-all; text-align: center; }
.pcard .pbody { padding: 10px 12px; }
.pcard .pmodel { font-size: 14px; font-weight: 600; color: var(--text-main); word-break: break-all; }
.pcard .pmeta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.pcard .pcat { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.pcard .pbrand { margin-left: auto; }
.pdetail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pdetail-title h2 { font-size: 18px; color: var(--text-main); }
.use-badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.use-badge.promo { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.use-badge.after { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.mcard .media-use { font-size: 10px; border-radius: 999px; padding: 0 6px; }
.mcard .media-use.promo { background: var(--primary-light); color: var(--primary); }
.mcard .media-use.after { background: #fee2e2; color: #b91c1c; }
.empty-tip { padding: 30px 0; text-align: center; color: var(--text-muted); font-size: 13px; }
@media (max-width: 900px) {
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}

/* ===== v23 字典管理：编辑行对齐修复 ===== */
tr.dict-edit-row > td {
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
tr.dict-edit-row.dict-editing > td { background: var(--primary-light); }
tr.dict-row.dict-editing > td { background: var(--primary-light); }
.dict-edit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dict-edit-form input[type="text"],
.dict-edit-form input[type="number"],
.dict-edit-form select,
.dict-edit-form .cs-trigger {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-main);
  outline: none;
}
.dict-edit-form input[type="text"]:focus,
.dict-edit-form input[type="number"]:focus,
.dict-edit-form select:focus,
.dict-edit-form .cs-trigger:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.dict-edit-form input[type="text"] { min-width: 130px; flex: 0 1 auto; }
.dict-edit-form select { min-width: 110px; flex: 0 1 auto; }
.dict-edit-form .cs-wrap { min-width: 110px; flex: 0 1 auto; width: auto; }
.dict-edit-form input[type="number"] { width: 80px; }
.dict-edit-form .btn { margin: 0; }

/* ===== v23 IMEI 快速查询弹窗 ===== */
.imei-q-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.imei-q-summary b { color: var(--primary); font-size: 16px; }
.imei-q-section { margin-top: 16px; }
.imei-q-section .sub-title { margin-bottom: 8px; }

/* ===== 售后管理系统前端改造（20261015） ===== */
/* 待收费高亮 */
.tag-pay { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
/* 配件类型标签 */
.tag-parts { background: #fef3c7; color: #92400e; }
/* 详情页待收费提示条 */
.pay-warn {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 10px 14px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius);
  color: #b91c1c; font-size: 14px; font-weight: 600;
}
.pay-warn-dot { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; flex: none; }
/* 详情页区块 */
.detail-section { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.detail-section > h3 { margin: 0 0 10px; font-size: 15px; color: var(--primary); border-left: 3px solid var(--primary); padding-left: 8px; }
.detail-section .detail-grid { margin-top: 4px; }
/* 详情页吸顶切换按钮 */
.switch-fab {
  position: sticky; top: 12px; z-index: 40; float: right;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .25);
}
/* 导入历史表格 */
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.btn-sm { padding: 3px 10px; font-size: 13px; }

/* ===== 工单表单响应式多列网格（v1.0.0） ===== */
.form-grid.ticket-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
}
.form-grid.ticket-grid .field { min-width: 0; }
.form-grid.ticket-grid .field.full { grid-column: 1 / -1; }
/* v1.12 跨 3 列字段（具体描述 + 右侧处理人凑齐一行） */
.form-grid.ticket-grid .field.span3 { grid-column: span 3; }
.form-grid.ticket-grid .field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 500;
}
.form-grid.ticket-grid .field .req { color: var(--tag-danger-text); margin-left: 2px; }
.form-grid.ticket-grid input,
.form-grid.ticket-grid select,
.form-grid.ticket-grid textarea { width: 100%; }
/* 同组字段缩排：浅色分组卡片 */
.form-grid.ticket-grid.group-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
/* 断点：1000~1199 -> 3 列；768~999 -> 2 列；<768 -> 单列（>1200 默认 4 列） */
@media (min-width: 1000px) and (max-width: 1199px) {
  .form-grid.ticket-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.ticket-grid .field.span3 { grid-column: span 2; }
}
@media (min-width: 768px) and (max-width: 999px) {
  .form-grid.ticket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.ticket-grid .field.span3 { grid-column: auto; }
}
@media (max-width: 767px) {
  .form-grid.ticket-grid { grid-template-columns: 1fr; }
  .form-grid.ticket-grid .field.span3 { grid-column: auto; }
  .form-grid.ticket-grid.group-card { padding: 10px 12px; }
}

/* ===== 更新日志页面（v1.0.0） ===== */
.changelog-list { display: flex; flex-direction: column; gap: 12px; }
.changelog-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.changelog-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.changelog-version {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.changelog-type {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}
.changelog-type.type-major { background: var(--tag-danger-bg); color: var(--tag-danger-text); }
.changelog-type.type-minor { background: var(--tag-warning-bg); color: var(--tag-warning-text); }
.changelog-type.type-patch { background: var(--tag-info-bg); color: var(--tag-info-text); }
.changelog-date { font-size: 12px; color: var(--text-muted); }
.changelog-content {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.7;
  white-space: pre-line;
  word-break: break-word;
}

/* ==========================================================================
   系统设置页：区块化排版（v1.2.0）
   基础参数 / 列显示设置 分区卡片，列排序用图标按钮，移动端单列
   ========================================================================== */
.settings-card { max-width: none; }
.settings-head { margin-bottom: 16px; }
.settings-head h2 { margin: 0 0 4px; }
.settings-head .hint { margin: 0; }

.settings-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.settings-block-head { margin-bottom: 14px; }
.settings-block-head h3 { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.settings-block-head .hint { margin: 0; }

.settings-grid { grid-template-columns: repeat(2, 1fr); }

.settings-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.settings-col-panel {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg-subtle);
  min-width: 0;
}
.settings-col-title { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.settings-col-panel .hint { margin: 0 0 10px; }

.col-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.col-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.col-name { font-size: 13px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-ops { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.col-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.col-btn:hover { border-color: var(--primary); color: var(--primary); }
.col-btn.col-remove:hover { border-color: #dc2626; color: #dc2626; }
.col-add { display: flex; gap: 8px; }
.col-add select { flex: 1 1 auto; min-width: 0; }

.settings-card .form-actions { margin-top: 4px; }

@media (max-width: 768px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-cols { grid-template-columns: 1fr; }
  .settings-block { padding: 14px; }
}

/* ========== 字典管理页 v1.3.0（左侧分组导航 + 右侧面板） ========== */
.dict-card { max-width: none; }
.dict-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 16px; margin-bottom: 16px;
}
.dict-head-title h2 { margin: 0; }
.dict-head-title .hint { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.dict-head-actions { display: flex; gap: 8px; }

/* 覆盖旧 .dict-layout（原 auto-fit 平铺），改为左导航 + 右面板 */
.dict-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.dict-nav {
  position: sticky; top: 16px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); padding: 12px 10px;
  display: flex; flex-direction: column; gap: 14px;
}
.dict-nav-group { display: flex; flex-direction: column; gap: 2px; }
.dict-nav-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; padding: 0 10px 5px;
}
.dict-nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 8px;
  color: var(--text-main, #1f2937); font-size: 13px;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dict-nav-item:hover { background: var(--bg-subtle); }
.dict-nav-item.active {
  background: var(--primary-light);
  color: var(--primary, #2563eb); font-weight: 600;
}
.dict-nav-count {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-subtle); border-radius: 999px; padding: 1px 7px;
}
.dict-nav-item.active .dict-nav-count { background: #dbeafe; color: var(--primary, #2563eb); }

.dict-panels { display: flex; flex-direction: column; gap: 14px; }
.dict-panel {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); padding: 16px 18px 18px;
}
.dict-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 10px;
}
.dict-panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--text-main, #1f2937);
}
.dict-panel-badge {
  font-size: 11px; font-weight: 600; color: var(--primary, #2563eb);
  background: var(--primary-light); border-radius: 999px; padding: 2px 8px;
}
.dict-panel-desc { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.btn-add {
  width: 28px; height: 28px; flex: none;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--primary, #2563eb);
  font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s;
}
.btn-add:hover { border-color: var(--primary, #2563eb); background: var(--primary-light); }

.dict-table { width: 100%; border-collapse: collapse; }
.dict-table th {
  background: var(--bg-subtle); text-align: left;
  font-size: 12px; color: var(--text-muted);
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dict-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-main, #1f2937);
}
.dict-table tbody tr:last-child td { border-bottom: none; }
.dict-table tbody tr:hover td { background: #f8fafc; }
.dict-op-col { text-align: right; width: 1%; }
.dict-op-cell { white-space: nowrap; text-align: right; }

.dict-op {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; margin-left: 6px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text-main, #374151);
  font-size: 12px; cursor: pointer; transition: all 0.15s;
  vertical-align: middle;
}
.dict-op:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.dict-op-del { color: #dc2626; }
.dict-op-del:hover { border-color: #dc2626; background: #fef2f2; color: #dc2626; }

.dict-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.dict-status.on  { background: #ecfdf5; color: #059669; }
.dict-status.off { background: var(--bg-subtle); color: var(--text-muted); }
.dict-parent { color: var(--text-muted); font-size: 12px; }

.dict-empty-row td { padding: 26px 12px !important; text-align: center; }
.dict-empty { color: var(--text-muted); font-size: 13px; }
.add-box { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.add-box form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.add-box input[type="text"], .add-box select { min-width: 150px; }

@media (max-width: 900px) {
  .dict-layout { grid-template-columns: 1fr; }
  .dict-nav {
    position: static; flex-direction: row; flex-wrap: wrap;
    padding: 10px; gap: 8px 4px;
  }
  .dict-nav-group { min-width: 100%; }
  .dict-nav-item { flex: 0 1 auto; }
}

/* ============================================================
   18. v1.4.0 全站风格统一补充
   （以 settings.html / dict.html 重排风格为基准）
   ============================================================ */
/* 下拉菜单（工单列表售后发货导出） */
.dropdown-wrap { display: inline-block; position: relative; }
.dropdown-menu {
  display: block;
  position: absolute; top: 100%; right: 0;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .10);
  z-index: 50;
  min-width: 190px;
  padding: 6px;
}
.dropdown-item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 14px;
}
.dropdown-item:hover { background: var(--bg-subtle); color: var(--primary); }

/* 岗位管理：区块头操作区与权限胶囊 */
.role-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-details { margin-top: 10px; }
.role-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  display: inline-block;
}
.check-pills label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.check-pills label:hover { border-color: var(--primary); }
.check-pills label:has(input:checked) {
  border-color: var(--primary);
  background: rgba(37, 99, 235, .08);
  color: var(--primary);
}
.check-pills input { accent-color: var(--primary); }

/* 媒体卡片网格（产品详情/出库查询）对齐区块间距 */
.settings-block .mgrid { margin-top: 12px; }



/* --------------------------------------------------------------------------
   v1.7.0 换货寄回页面（return_exchange.html）
   -------------------------------------------------------------------------- */
.flash-info { background: #eff6ff; color: #1d4ed8; }
.rx-pending {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 13px;
}
.rx-sum { margin-top: 6px; font-size: 13px; }
.import-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.import-upload input[type="file"] {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
}
#rx-result:empty { display: none; }
#rx-result .flash { margin-top: 12px; }

/* --------------------------------------------------------------------------
   v1.8.0 全站统一分页控件（服务端 _pager.html 与前端 pager.js 共用）
   规格：左「共 N 条」+ 每页条数(20/50/100/200，默认 50) + 上/下一页 +
        页码首尾与当前附近、中间 … 折叠 + 前往 __ 页
   -------------------------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.pager-total { color: var(--text-muted); white-space: nowrap; }
.pager-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.pager-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.pager-select,
.pager-input {
  height: 28px;
  padding: 0 6px;
  font-size: 13px;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
}
.pager-select { padding-right: 4px; cursor: pointer; }
.pager-select:focus,
.pager-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.pager-input { width: 52px; text-align: center; -moz-appearance: textfield; }
.pager-input::-webkit-outer-spin-button,
.pager-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pager-btn,
.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
  line-height: 1;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.pager-btn:hover:not(:disabled):not(.is-disabled),
.pager-num:hover { border-color: var(--primary); color: var(--primary); }
.pager-num.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.pager-btn.is-disabled,
.pager-btn:disabled {
  color: #b9c0cc;
  background: var(--bg-subtle);
  border-color: var(--border);
  cursor: not-allowed;
  pointer-events: none;
}
.pager-ellipsis { padding: 0 2px; color: var(--text-muted); user-select: none; }
.pager-jump { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; }
.pager-jump-label { color: var(--text-muted); }
.pager .pg-hidden { display: none !important; }

@media (max-width: 720px) {
  .pager { justify-content: center; }
  .pager-total { width: 100%; text-align: center; }
  .pager-controls { justify-content: center; width: 100%; gap: 6px; }
  .pager-num { min-width: 26px; padding: 0 6px; }
  .pager-jump { width: 100%; justify-content: center; }
}

/* --------------------------------------------------------------------------
   v1.13.0 右侧固定列（环节标签 + 操作）：左侧信息列横向滚动，右侧两列钉住
   - 最右一列（操作）贴边 right:0；前一列（环节标签）按操作列宽度偏移，避免两列重叠
   -------------------------------------------------------------------------- */
.table-wrap th.sticky-right,
.table-wrap td.sticky-right {
  position: sticky;
  z-index: 2;
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 10px -10px rgba(15, 23, 42, .18);
  background: var(--surface);
}
.table-wrap thead th.sticky-right {
  top: 0;                       /* 与表头自带的纵向 sticky 叠加 */
  z-index: 3;
  background: var(--bg-subtle);
}
/* 最右侧的固定列贴边 */
.table-wrap tr > *:last-child.sticky-right { right: 0; }
tbody tr:hover td.sticky-right { background: var(--bg-subtle); }
tr.editing td.sticky-right { background: #fffbeb; }   /* 行编辑态的黄底保持一致 */

/* 右侧固定区宽度（v1.9.0）：操作列 + 环节标签列 + 工单进度列，三列宽度必须固定，
   否则 sticky 偏移量与实际宽度不一致会互相叠压 */
#ticket-table {
  --col-actions-w: 132px;
  --col-tags-w: 150px;
  --col-progress-w: 124px;
}
table.board-table {
  --col-actions-w: 78px;
  --col-tags-w: 140px;
  --col-progress-w: 116px;
}

/* 操作列贴边 right:0 */
.table-wrap .col-actions { width: var(--col-actions-w); min-width: var(--col-actions-w); }
/* 环节标签列：紧贴操作列左侧 */
.table-wrap .sticky-right-1 { right: var(--col-actions-w); }
/* 工单进度列：紧贴环节标签列左侧 */
.table-wrap .sticky-right-2 { right: calc(var(--col-actions-w) + var(--col-tags-w)); }

/* 工单进度列 */
.table-wrap .col-progress { width: var(--col-progress-w); min-width: var(--col-progress-w); }

/* 环节标签列（A 方案：紧凑标签流，自动换行最多两排） */
.table-wrap .cell-stage-tags {
  width: var(--col-tags-w);
  min-width: var(--col-tags-w);
  max-width: var(--col-tags-w);
  white-space: normal;
  line-height: 20px;
  background: #fcfdff;              /* 与可拖动区做淡淡的分层 */
}
.table-wrap .cell-stage-tags .tag-stage {
  height: 18px;
  padding: 0 7px;
  font-size: 11px;
  line-height: 16px;
  margin: 1px 3px 1px 0;
  white-space: nowrap;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   工单进度条（v1.9.0）：4 个节点 + 进度轨道 + 节点名称
   done=绿实心，current=琥珀空心圈，todo=灰空心；轨道按 --p 百分比双色填充
   -------------------------------------------------------------------------- */
.table-wrap .prog { display: block; padding: 0 5px; }
.table-wrap .prog-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 9px;
}
.table-wrap .prog-track::before {
  content: "";
  position: absolute;
  left: 4px; right: 4px; top: 3.5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, #4ade80 var(--p, 0%), #e2e8f0 var(--p, 0%));
}
.table-wrap .prog-dot {
  position: relative;
  z-index: 1;
  flex: 0 0 9px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #cbd5e1;
}
.table-wrap .prog-dot.is-done { background: #22c55e; box-shadow: none; }
.table-wrap .prog-dot.is-current { background: #fff; box-shadow: inset 0 0 0 2.5px #f59e0b; }
.table-wrap .prog-lbls {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
}
/* 标签盒子与圆点等宽并居中：文字自然溢出两侧，始终对齐在圆点正下方 */
.table-wrap .prog-lbls > span {
  flex: 0 0 9px;
  width: 9px;
  text-align: center;
  font-size: 10px;
  line-height: 13px;
  white-space: nowrap;
  color: #cbd5e1;
}
.table-wrap .prog-lbls > span.is-done { color: #64748b; }
.table-wrap .prog-lbls > span.is-current { color: #b45309; font-weight: 700; }

/* 环节标签配色 */
.tag-stage-follow { background: #fef3c7; color: #92400e; border-color: #fde68a; }   /* 需跟进：琥珀 */
.tag-stage-detect { background: #e0f2fe; color: #075985; border-color: #bae6fd; }   /* 待检测：蓝 */
.tag-stage-pay    { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }   /* 待收费：红 */
.tag-stage-return { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }   /* 待返厂：紫 */
.tag-stage-ship   { background: #dcfce7; color: #166534; border-color: #bbf7d0; }   /* 待寄出：绿 */
/* 待联系：青绿（客户在等回访）。不用红/粉——「待收费」已是红，两个红标签并排会分不清 */
.tag-stage-contact{ background: #cbfbf1; color: #0f766e; border-color: #5eead4; }
/* 已完结（v1.11.4）：结果类标签，实心深绿 + 对勾，比待办标签大一圈（18px → 24px），
   靠「实心 vs 浅底描边」区分结果/待办，不只依赖颜色 */
.tag-stage-done { background: #3b6d11; color: #fff; border-color: #3b6d11; }
.table-wrap .cell-stage-tags .tag-stage-done {
  height: 24px;
  padding: 0 11px;
  font-size: 13px;
  line-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.tag-done-ico { flex: 0 0 auto; }

/* ---- v1.10.1 客服设置：多组工作时间 ---- */
.schedule-list { display: flex; flex-direction: column; gap: 8px; }
.schedule-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg-subtle);
}
.schedule-row .sch-label { width: 170px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.schedule-row .sch-days { display: inline-flex; gap: 2px; }
.schedule-row .sch-day {
  display: inline-flex; align-items: center; gap: 2px; font-size: 12px;
  padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer;
  color: var(--text-muted); user-select: none;
}
.schedule-row .sch-day:has(input:checked) { background: var(--tag-info-bg); color: var(--tag-info-text); border-color: var(--tag-info-text); }
.schedule-row .sch-day input { accent-color: var(--primary); margin: 0; }
.schedule-row input[type="time"] { padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; width: 108px; }
.schedule-row .sch-sep { color: var(--text-muted); font-size: 12px; }
.schedule-row .btn { flex: none; }
.check-pills-label { display: flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.check-pills-label input { accent-color: var(--primary); }

/* ---- v1.10.1 知识库管理页 ---- */
.kb-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.kb-tabs { display: inline-flex; gap: 4px; background: var(--bg-subtle); border-radius: 8px; padding: 3px; }
.kb-tabs button { border: none; background: transparent; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-muted); }
.kb-tabs button.active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.kb-toolbar input[type="text"] { flex: 1; min-width: 220px; max-width: 360px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; }
.kb-toolbar input[type="text"]:focus { border-color: var(--primary); }
.kb-toolbar .btn { margin-left: auto; }
.kb-content-cell { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.btn-danger-soft { color: var(--tag-danger-text); }
.btn-danger-soft:hover { background: var(--tag-danger-bg); }

/* v1.12.2 检测照片上传区：点选 / 拖拽 / 粘贴 */
.photo-drop {
  border: 1.5px dashed var(--border, #d0d5dd); border-radius: 8px;
  padding: 14px 12px; text-align: center; cursor: pointer;
  color: var(--text-muted, #667085); font-size: 13px;
  transition: border-color .15s ease, background .15s ease;
  user-select: none;
}
.photo-drop:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.photo-drop.drag-over { border-color: var(--primary, #2563eb); background: rgba(37, 99, 235, .06); color: var(--primary, #2563eb); }
.photo-drop input[type="file"] { display: none; }

/* v1.12.3 通用图片预览灯箱（openLightbox） */
.imgv-mask {
  position: fixed; inset: 0; z-index: 99990; background: rgba(8, 12, 20, .87);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.imgv-mask[hidden] { display: none; }
.imgv-img {
  max-width: 92vw; max-height: 86vh; border-radius: 8px; background: #0b1220;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55); cursor: zoom-in; user-select: none;
  will-change: transform;
}
.imgv-img.grabbing { cursor: grabbing; }
.imgv-bar { position: absolute; top: 14px; right: 16px; display: flex; gap: 8px; z-index: 2; }
.imgv-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; line-height: 1;
  cursor: pointer; text-decoration: none;
}
.imgv-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.imgv-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 68px;
  display: flex; align-items: center; justify-content: center; padding: 0 0 6px;
  font-size: 34px; line-height: 1; color: #fff; background: rgba(255, 255, 255, .10);
  border: none; border-radius: 10px; cursor: pointer;
}
.imgv-arrow:hover { background: rgba(255, 255, 255, .24); }
.imgv-arrow[hidden] { display: none; }
.imgv-arrow.prev { left: 18px; }
.imgv-arrow.next { right: 18px; }
.imgv-cap {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .88); font-size: 13px; letter-spacing: .5px;
}
body.imgv-open { overflow: hidden; }

/* 检测照片缩略图（工单表单 / 详情） */
.photo-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.photo-item { position: relative; display: inline-block; }
.photo-item img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: zoom-in; display: block;
  transition: transform .12s ease, box-shadow .12s ease;
}
.photo-item img:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15, 23, 42, .16); }
.photo-del {
  position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; padding: 0;
  border: none; border-radius: 50%; background: rgba(17, 24, 39, .72); color: #fff;
  font-size: 13px; line-height: 20px; text-align: center; cursor: pointer;
}
.photo-del:hover { background: #dc2626; }
.det-photo {
  width: 64px; height: 64px; object-fit: cover; border-radius: 6px; margin-right: 6px;
  border: 1px solid var(--border); cursor: zoom-in; vertical-align: middle;
  transition: box-shadow .12s ease;
}
.det-photo:hover { box-shadow: 0 3px 12px rgba(15, 23, 42, .18); }

/* v1.10.9 凭证组随接入模式显隐 */
.prof-fields { display: contents; }
.prof-fields.hidden-prof { display: none; }

/* v1.10.9-9 侧边栏折叠（桌面端）：brand 行「«」收起，收起后左上角悬浮「»」展开，localStorage 记忆 */
.nav-fold {
  margin-left: auto;
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.nav-fold svg { width: 14px; height: 14px; }
.nav-fold:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-ring);
}

.nav-expand {
  position: fixed; left: 10px; top: 12px; z-index: 900;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
}
.nav-expand svg { width: 16px; height: 16px; }
.nav-expand:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-ring);
}

@media (min-width: 901px) {
  .topnav { transition: width 0.18s ease, flex-basis 0.18s ease, padding 0.18s ease; }
  .app-body.nav-collapsed .topnav {
    flex: 0 0 0;
    width: 0;
    padding: 0;
    border-right-color: transparent;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .app-body.nav-collapsed .nav-expand { display: flex; }
}
@media (max-width: 900px) {
  .nav-fold { display: none; }        /* 窄屏用汉堡按钮，不用折叠 */
  .nav-expand { display: none !important; }
}

/* ==================== 报表看板（v1.10.9-20） ==================== */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.kpi-card .k-label { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.kpi-card .k-val { font-size: 22px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.kpi-card .k-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.rpt-section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 20px 0 10px; font-size: 15px; font-weight: 700; color: var(--text-main);
}
.rpt-section-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--primary);
}
.rpt-model-pick {
  margin-left: auto; font-size: 12px; padding: 3px 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-main);
}
.rpt-stat-rows { padding: 4px 0; }
.rpt-stat-rows .stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 2px; font-size: 13px; color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
}
.rpt-stat-rows .stat-row:last-child { border-bottom: none; }
.rpt-stat-rows .stat-row strong { color: var(--text-main); font-size: 15px; }
.rpt-tip {
  margin-top: 10px; background: var(--bg-subtle); padding: 10px 12px; border-radius: 8px;
  border-left: 4px solid var(--primary); font-size: 12px; color: var(--text-muted);
}

/* ==========================================================================
   系统设置页 v1.11 重构：左分类导航 + 行式表单（标签在左、控件在右）
   旧的 .settings-block 等类保留不动，其他页面继续使用
   ========================================================================== */
.set-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px 20px; flex-wrap: wrap; margin: 0 0 16px;
}
.set-head-l h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-main); }
.set-head-l p { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); }

/* 分类标签横排在页头右侧，不单独占一列 */
.set-tabs {
  display: flex; align-items: center; gap: 3px; flex: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.set-nav-item {
  display: block; padding: 6px 14px; border-radius: 7px;
  font-size: 13px; color: var(--text-main); text-decoration: none;
  white-space: nowrap; transition: background .15s, color .15s;
}
.set-nav-item:hover { background: var(--bg-subtle); }
.set-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.set-layout { display: block; }

/* 宽屏下短字段不能跟着拉通整行：单个数字/短文本统一限宽，长文本仍占满 */
.set-row-body .field > input:not([type="checkbox"]):not([type="radio"]),
.set-row-body .field > select { max-width: 360px; }
.set-row-body .field > textarea { max-width: 100%; }
#wecomPort { max-width: 120px; }

.set-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.set-sec {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px 4px;
}
.set-sec-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--border);
}
.set-sec-title { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.set-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-light); font-size: 15px;
}
.set-sec-title h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-main); }
.set-sec-title p { margin: 3px 0 0; font-size: 12px; color: var(--text-muted); }
.set-badge {
  flex: none; font-size: 11.5px; font-weight: 600; color: var(--primary);
  background: var(--primary-light); border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}

/* 一行 = 左说明 + 右控件 */
.set-row {
  display: grid; grid-template-columns: 176px minmax(0, 1fr);
  gap: 8px 20px; padding: 16px 0; border-bottom: 1px dashed var(--border);
}
.set-row:last-child { border-bottom: 0; }
.set-row-side h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-main); }
.set-row-side p { margin: 4px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.6; }
.set-row-body { min-width: 0; }
.set-row-body .field:last-child { margin-bottom: 8px; }

.settings-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* v1.11.29：备份策略四项一行（开关/时间/间隔/保留份数） */
.settings-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .settings-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
}

/* 说明小字 / 按钮行 / 提示块 */
.set-tip { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; margin: 5px 0 0; }
.set-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.set-inline .set-tip { margin: 0; }
.set-note {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px;
  background: #fffbeb; border: 1px solid #fde68a;
  font-size: 11.5px; color: #92400e; line-height: 1.65;
}
.set-note b { color: #b45309; }
.set-linkline { margin: 10px 0 0; }
.set-acc {
  margin-top: 8px; font-size: 11.5px; color: var(--text-muted);
  line-height: 1.6; word-break: break-all;
}

/* 接入模式：可点选卡片 */
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card {
  display: flex; gap: 9px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.mode-card:hover { border-color: #93c5fd; }
.mode-card input { flex: none; margin: 3px 0 0; accent-color: var(--primary); }
.mode-card:has(input:checked) {
  border-color: var(--primary); background: #f5f9ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .07);
}
.mode-body { min-width: 0; }
.mode-body b { display: block; font-size: 13px; color: var(--text-main); }
.mode-body em {
  display: block; font-style: normal; font-size: 11.5px;
  color: var(--text-muted); margin-top: 1px;
}
.mode-body small { display: block; font-size: 11px; color: var(--text-muted); line-height: 1.55; margin-top: 6px; }

.set-sec .settings-cols { padding-top: 15px; }

/* 凭证分组 */
.prof-fields {
  border: 1px solid var(--border); border-radius: 10px;
  background: #fbfcfe; padding: 13px 14px 4px; margin-bottom: 12px;
}
.prof-fields:last-child { margin-bottom: 0; }
.prof-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--text-main);
  margin-bottom: 11px;
}
.prof-title::before {
  content: ""; flex: none; width: 3px; height: 12px;
  border-radius: 2px; background: var(--primary);
}
.prof-title span { font-weight: 400; font-size: 11.5px; color: var(--text-muted); }

/* 底部保存条 */
.set-actions {
  position: sticky; bottom: 0; z-index: 6;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 -4px 18px rgba(15, 23, 42, .06);
}
.set-actions-tip { margin-right: auto; font-size: 11.5px; color: var(--text-muted); }

@media (max-width: 940px) {
  .set-page-head { align-items: stretch; }
  .set-head-l { flex: 1 1 100%; }
  .set-tabs { flex: 1 1 auto; overflow-x: auto; }
}
@media (max-width: 760px) {
  .set-sec { padding: 14px 14px 2px; }
  .set-row { grid-template-columns: 1fr; gap: 10px; padding: 14px 0; }
  .set-row-side p { margin-top: 2px; }
  .mode-cards { grid-template-columns: 1fr; }
  .forms-grid, .set-row-body .settings-grid { grid-template-columns: 1fr; }
  .set-actions { padding: 10px 12px; }
}

/* --------------------------------------------------------------------------
   日期选择器（datepicker.js）：单日期 + 起止范围，风格与全局控件统一
   -------------------------------------------------------------------------- */
.dp-pop {
  position: fixed;
  z-index: 10050;
  display: none;
  min-width: 268px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 10px 12px 8px;
  font-size: 13px;
  color: var(--text-main);
  user-select: none;
}
.dp-two { display: flex; gap: 18px; }
.dp-two .dp-month { width: 232px; }

.dp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 8px;
}
.dp-label { font-weight: 600; font-size: 13px; color: var(--text-main); }
.dp-ic {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.12s ease;
}
.dp-ic:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.dp-mtitle {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 0 6px;
}
.dp-two .dp-mtitle { padding-top: 0; }

.dp-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-head span {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 0;
}
.dp-day {
  height: 30px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-main);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
.dp-day:hover { background: var(--primary-light); color: var(--primary); }
.dp-day.out { color: #c7cdd6; }
.dp-day.out:hover { background: var(--bg-subtle); color: var(--text-muted); }
.dp-day.today { font-weight: 700; color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-ring); }
.dp-day.sel { background: var(--primary); color: #fff; font-weight: 600; box-shadow: none; }
.dp-day.sel:hover { background: var(--primary-hover); color: #fff; }
.dp-day.inrange { background: var(--primary-light); border-radius: 0; }
.dp-day.start { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
.dp-day.end { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.dp-day.start.end { border-radius: var(--radius-xs); }

.dp-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.dp-quick { justify-content: space-between; flex-wrap: wrap; }
.dp-link {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.12s ease;
}
.dp-link:hover { background: var(--primary-light); }
.dp-link.primary {
  background: var(--primary);
  color: #fff;
  padding: 5px 14px;
  font-weight: 500;
}
.dp-link.primary:hover { background: var(--primary-hover); }

/* 范围触发框：一个框里显示起止日期 */
.dp-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dp-range::before {
  content: "";
  flex: 0 0 14px;
  height: 14px;
  opacity: 0.55;
  background: no-repeat center/14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
.dp-range:hover { border-color: var(--primary); }
.dp-range.has-val { color: var(--text-main); }
.filter-bar .dp-range { padding: 7px 10px; }

/* 兜底：仍有原生 date input 时统一外观（隐藏浏览器自带日历图标） */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 36px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 0.85; }

/* ---------------------------------------------------------------------------
   自定义下拉（customselect.js）：触发器 + 弹层，观感与日期弹层统一
   --------------------------------------------------------------------------- */
.cs-native { display: none !important; }
/* inline-block：与原生 select/input 的默认 display 一致，margin 不与 label 折叠，
   否则比同行输入框高 4px（.form-grid 里 label margin-bottom 5 + 控件 margin-top 4） */
.cs-wrap { position: relative; display: inline-block; width: 100%; max-width: 100%; vertical-align: top; }
.cs-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}
.cs-trigger .cs-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-trigger .cs-placeholder { color: #9ca3af; }
.cs-trigger .cs-ic {
  flex: 0 0 16px;
  height: 16px;
  opacity: 0.55;
  background: no-repeat center/14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.cs-trigger:hover { border-color: var(--primary); }
.cs-trigger:disabled { cursor: not-allowed; opacity: 0.6; }
.cs-wrap.cs-disabled .cs-trigger { background: var(--bg-subtle); color: var(--text-muted); }

.cs-pop {
  position: fixed;
  z-index: 10060;
  display: none;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 6px;
  font-size: 13px;
  color: var(--text-main);
  user-select: none;
}
.cs-pop .cs-grp {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.cs-pop .cs-opt {
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-pop .cs-opt:hover { background: var(--primary-light); color: var(--primary); }
.cs-pop .cs-opt.cs-on { background: var(--primary-light); color: var(--primary); }
.cs-pop .cs-opt.cs-sel { background: var(--primary); color: #fff; font-weight: 500; }
.cs-pop .cs-opt.cs-sel.cs-on,
.cs-pop .cs-opt.cs-sel:hover { background: var(--primary-hover); color: #fff; }
.cs-pop .cs-opt.cs-dis { color: #c7cdd6; cursor: not-allowed; background: transparent; }

/* v1.11.9 下拉关键词搜索：弹层顶部搜索框（选项较多的下拉自动出现） */
.cs-pop .cs-search {
  position: sticky; top: 0; z-index: 1;
  padding: 4px 6px 8px; margin: -6px -6px 4px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.cs-pop .cs-search-in {
  width: 100%; box-sizing: border-box; height: 30px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: var(--radius-xs, 6px);
  font-size: 13px; color: var(--text-main); background: #fff; outline: none;
}
.cs-pop .cs-search-in:focus { border-color: var(--primary); }
.cs-pop .cs-opt.cs-hide, .cs-pop .cs-grp.cs-hide { display: none; }
.cs-pop .cs-empty { padding: 14px 10px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* v1.11.8 字典管理「新增」改为居中弹窗 */
.dict-modal-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45); z-index: 9000;
}
.add-box.open {
  display: block !important;
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 9001; width: min(440px, calc(100vw - 32px));
  background: var(--surface, #fff);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  padding: 16px; margin: 0; border-top: 1px solid var(--border);
}
.add-box .add-box-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: -16px -16px 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px; color: var(--text-main);
}
.add-box .add-box-close {
  border: none; background: none; font-size: 20px; line-height: 1;
  color: var(--text-muted); cursor: pointer; padding: 0 4px;
}
.add-box .add-box-close:hover { color: #ef4444; }

/* 详情页换机多行 */
.detail-grid .swap-line { display: block; font-size: 13px; color: var(--text-main); line-height: 1.7; }

/* 换货寄回 · 导出字段设置弹窗 */
.rx-cols-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; }
.rx-col-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
}
.rx-col-row:hover { background: var(--bg-subtle); }
.rx-col-row.off .rx-col-label { color: var(--text-muted); }
.rx-col-label { flex: 1; display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.rx-col-label input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }
.rx-col-tag {
  font-size: 11px;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 0 6px;
  line-height: 17px;
}
.rx-col-btns { display: inline-flex; gap: 4px; }
.rx-col-btns .btn-small { padding: 2px 8px; font-size: 12px; }
