/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1677ff;
  --primary-light: #e6f4ff;
  --primary-dark: #0958d9;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --info: #909399;
  --text-main: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border-color: #e5e7eb;
  --bg-page: #f5f5f5;
  --bg-card: #ffffff;
  --bg-hover: #f9fafb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --radius: 8px;
  --radius-sm: 4px;
  --sidebar-width: 220px;
  --header-height: 56px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
}

/* ===== 布局 ===== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: #001529;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s;
}

.sidebar-logo {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo span { font-size: 20px; margin-right: 8px; }

.sidebar-menu { padding: 8px 0; }

.menu-group-title {
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  padding: 12px 20px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.menu-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.menu-item.active { color: #fff; background: var(--primary); }
.menu-item .icon { width: 20px; margin-right: 10px; text-align: center; font-size: 16px; }
.menu-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

  .main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* v147：.app-layout 是 row 方向的 flex 容器，flex item 默认 min-width:auto
       → 不允许收缩到「内容固有宽度」以下。行程明细表列多（实测 24 列、固有宽 3032px），
       会把 .main-area 连同整页一起撑破；此时 .table-wrap 的宽度也被撑到与表格同宽
       （对自身而言"恰好装满"），overflow-x:auto 永远不触发 ——
       表现就是「表格显示不全，但下方没有横向滚动条」。
       显式 min-width:0 解除该下限，让内容区回到视口宽度，超宽表格交给 .table-wrap 自己滚。 */
    min-width: 0;
  }

.topbar {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-time { color: var(--text-secondary); font-size: 13px; }

/* 汉堡菜单按钮（仅移动端显示） */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-main);
  padding: 6px;
  margin-right: 6px;
}

/* 侧边栏遮罩（移动端） */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 90;
}

.content {
  flex: 1;
  padding: 20px 24px;
}

/* ===== 通用组件 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}

.card-body { padding: 20px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-main);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-text { border: none; background: none; padding: 4px 8px; color: var(--primary); }
.btn-text:hover { background: var(--primary-light); }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { background: #fff1f0; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 表单 */
.form-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.form-group { flex: 1; min-width: 200px; }
.form-group-full { flex-basis: 100%; min-width: 100%; }
.header-edit {
  width: 100%;
  height: 32px;
  padding: 4px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.header-edit:hover { border-color: #b0b0b0; }
.header-edit:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,0.12); }
.header-edit.header-num { text-align: right; font-variant-numeric: tabular-nums; }
.header-edit.header-textarea { height: auto; min-height: 48px; padding: 6px 10px; resize: vertical; font-family: inherit; }
.header-edit.cell-saved { background: #f6ffed; border-color: #52c41a; }
.header-customer { display: flex; gap: 6px; }
.header-customer .header-edit { flex: 1; min-width: 0; }
.readonly-cell { padding: 4px 0; color: var(--text-secondary); font-family: monospace; font-size: 13px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.form-group label .required { color: var(--danger); margin-left: 2px; }

/* 订单详情页表头字段：紧凑网格布局 */
#detailHeaderFieldsWrap {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px 10px;
  margin-bottom: 0;
}
#detailHeaderFieldsWrap .form-group {
  flex: none;
  min-width: 0;
  margin-bottom: 0;
}
#detailHeaderFieldsWrap .form-group[data-field="customer"] {
  grid-column: span 2;
}
#detailHeaderFieldsWrap .form-group[data-field="remark"] {
  grid-column: 1 / -1;
}
#detailHeaderFieldsWrap .form-group label {
  margin-bottom: 2px;
  font-size: 12px;
}
#detailHeaderFieldsWrap .header-edit,
#detailHeaderFieldsWrap select.header-edit {
  padding: 4px 8px;
  min-height: 30px;
  font-size: 13px;
}
#detailHeaderFieldsWrap .header-edit.header-textarea {
  min-height: 38px;
  padding: 4px 8px;
}
#detailHeaderFieldsWrap .readonly-cell {
  padding: 4px 0;
  min-height: 30px;
  line-height: 22px;
  box-sizing: border-box;
}
#detailHeaderFieldsWrap .header-customer {
  display: flex;
  gap: 6px;
}

/* v175：表头信息区改成「字段名 + 值」**同行**显示（原来是标签在上、控件在下两行，
   「表头信息」这一卡片纵向太占地方）。做法：把每个 .form-group 变成单行 flex ——
   标签按内容宽不收缩，其余子元素（input / select / 只读文本 / 客户姓名电话 /
   负责人下拉+＋按钮）吃掉剩余宽度。
   ⚠️ 只限定 #detailHeaderFieldsWrap。新建订单页、询价单页用的是通用 .form-row/.form-group，
      它们仍是「标签在上、控件在下」的两行样式，不受影响。 */
#detailHeaderFieldsWrap .form-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
#detailHeaderFieldsWrap .form-group > label {
  flex: 0 0 auto;
  margin-bottom: 0;
  white-space: nowrap;
}
#detailHeaderFieldsWrap .form-group > *:not(label) {
  flex: 1 1 auto;
  min-width: 0;
}
/* 「备注」是多行文本域：标签顶对齐更自然，别跟控件垂直居中 */
#detailHeaderFieldsWrap .form-group[data-field="remark"] {
  align-items: flex-start;
}
#detailHeaderFieldsWrap .form-group[data-field="remark"] > label {
  padding-top: 7px;
}

@media (max-width: 1200px) {
  #detailHeaderFieldsWrap { grid-template-columns: repeat(4, 1fr); }
  #detailHeaderFieldsWrap .form-group[data-field="customer"] { grid-column: span 2; }
}
@media (max-width: 768px) {
  #detailHeaderFieldsWrap { grid-template-columns: repeat(2, 1fr); }
  #detailHeaderFieldsWrap .form-group[data-field="customer"] { grid-column: span 2; }
  #detailHeaderFieldsWrap .form-group[data-field="remark"] { grid-column: 1 / -1; }
}
.input, .select, .textarea {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
  color: var(--text-main);
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}
.textarea { resize: vertical; min-height: 60px; }
.input.readonly { background: #f5f5f5; color: var(--text-secondary); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: #fafafa;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text-main);
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

/* v139：已取消订单整行置灰
   取消单的收入/成本/利润都不参与合计（见 v138 口径），但单元格里还留着原始数字方便核对单据。
   如果只用默认黑色显示，一眼看过去像在执行的单子，容易误判成"漏单/未处理"。
   所以整行统一降为三级灰 + 浅灰底 + 左侧竖条：
   · `td *` 必须带 !important —— 收入/成本/利润单元格是行内样式上色（如 style="color:var(--success)"），
     行内样式优先级高于普通类选择器，不加 !important 覆盖不掉，会出现"一半灰一半彩色"。
   · 背景加在 td 上（不是 tr）—— .data-table tbody tr:hover 给 tr 上了 hover 底色，
     td 背景在 tr 之上，这样鼠标划过时灰底不会被 hover 色冲掉。 */
.data-table tbody tr.row-cancelled > td,
.data-table tbody tr.row-cancelled > td * {
  color: var(--text-tertiary) !important;
}
.data-table tbody tr.row-cancelled > td {
  background: var(--bg-page);
}
.data-table tbody tr.row-cancelled > td:first-child {
  box-shadow: inset 3px 0 0 var(--text-tertiary);
}
.data-table tbody tr.row-cancelled:hover > td {
  background: #ededed;
}
/* 取消单的复选框也一并降透明度，避免整行灰了却有一个高对比度的蓝勾 */
.data-table tbody tr.row-cancelled input[type="checkbox"] {
  opacity: .55;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.tag-default { background: #f0f0f0; color: var(--text-secondary); }
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: #f6ffed; color: var(--success); border: 1px solid #b7eb8f; }
.tag-warning { background: #fffbe6; color: var(--warning); border: 1px solid #ffe58f; }
.tag-danger { background: #fff1f0; color: var(--danger); border: 1px solid #ffa39e; }
.tag-info { background: #e6f4ff; color: var(--info); border: 1px solid #91d5ff; }

/* 账户管理 - 左右分栏布局 */
.account-split {
  display: flex;
  gap: 16px;
  align-items: stretch;
  min-height: 500px;
}
.account-list-panel {
  flex: 0 0 320px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 75vh;
}
.account-detail-panel {
  flex: 1;
  min-width: 0;
}
.account-list-item {
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fff;
}
.account-list-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.account-list-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.account-list-item .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}
.account-list-item .balance {
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 4px;
}
.account-list-item .balance.positive { color: var(--primary); }
.account-list-item .balance.negative { color: var(--danger); }
.account-list-item .sub {
  font-size: 12px;
  color: var(--text-tertiary);
}
.stat-primary {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.stat-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}
@media (max-width: 900px) {
  .account-split { flex-direction: column; }
  .account-list-panel { flex: 0 0 auto; max-height: none; }
}

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.stat-card .label { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 24px; font-weight: 700; color: var(--text-main); }
.stat-card .value.primary { color: var(--primary); }
.stat-card .value.success { color: var(--success); }
.stat-card .value.danger { color: var(--danger); }
.stat-card .value.warning { color: var(--warning); }
.stat-card .sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* v115：可双击跳转报表的卡片（工作台） */
.stat-clickable { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; position: relative; }
.stat-clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .10); border-color: var(--primary); }
.stat-clickable:hover::after {
  content: '双击查看报表 ↗';
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  background: #f3f4f6;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1px 8px;
  pointer-events: none;
}

/* 筛选栏 */
.filter-bar {
  background: #fff;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-bar .form-group { min-width: 150px; flex: 1; max-width: 220px; }
.filter-bar .form-group label { margin-bottom: 4px; font-size: 12px; }
.filter-bar .actions { display: flex; gap: 8px; }

/* ===== v184 起：筛选栏「日期区间」；v186 改成「一个格子 + 向下展开面板」 =====
   用户反馈「两个格子太复杂」→ 收起为单格，格子里显示 `起 ~ 止`，
   点开后在下方展开：开始/结束 + 今天/本月/上月 + 清空/确定。
   ⚠️ 面板必须绝对定位：.filter-bar 是 align-items:flex-end，
      面板若参与流式布局会把同排其他控件顶下去、整排错位。 */
.filter-bar .form-group.is-range { min-width: 198px; max-width: 230px; flex: 1.1; }
.date-range { position: relative; }
.dr-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; cursor: pointer; background: #fff;
}
.dr-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--text-main);
}
.dr-text.is-empty { color: var(--text-tertiary); }
.dr-caret { flex: none; font-size: 10px; color: var(--text-tertiary); transition: transform .15s; }
.date-range.open .dr-caret { transform: rotate(180deg); }
.date-range.open .dr-trigger { border-color: var(--primary); }

.dr-panel {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 80;
  width: 252px; padding: 12px;
  background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}
.date-range.open .dr-panel { display: block; }
.dr-fields { display: flex; flex-direction: column; gap: 8px; }
.dr-fields label {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 12px; color: var(--text-secondary);
}
.dr-fields label > span { flex: none; width: 26px; }
.dr-fields input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 13px; }
.dr-presets { display: flex; gap: 6px; margin-top: 10px; }
.dr-presets a {
  padding: 3px 10px; font-size: 12px; line-height: 18px;
  color: var(--text-secondary); background: var(--bg-hover);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  cursor: pointer; user-select: none; transition: color .15s, border-color .15s, background .15s;
}
.dr-presets a:hover { color: var(--primary); border-color: var(--primary); }
.dr-presets a.active {
  color: var(--primary); border-color: var(--primary);
  background: var(--primary-light); font-weight: 600;
}
.dr-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.dr-clear { font-size: 12px; color: var(--text-tertiary); cursor: pointer; }
.dr-clear:hover { color: var(--primary); }

/* ===== v139：筛选栏「多选下拉」 =====
   用于订单状态这类需要同时勾选多个值的筛选（原来的 <select> 只能选一个，
   想同时看「待安排 + 已安排」就得来回切换）。
   面板用 absolute 定位 —— .filter-bar 没有 overflow:hidden，不会被裁掉。 */
.ms-select { position: relative; }
.ms-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}
.ms-toggle .ms-caret { font-size: 10px; color: var(--text-tertiary); }
.ms-toggle .ms-badge {
  font-size: 11px;
  line-height: 16px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
/* 一个都没勾时给个显眼的提示 —— 语义是「不过滤」，但用户容易以为是坏了 */
.ms-toggle.ms-none {
  border-color: var(--warning);
  color: var(--warning);
}
.ms-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
}
.ms-select.open .ms-panel { display: block; }
.ms-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
}
.ms-item:hover { background: var(--bg-hover); }
.ms-item input { margin: 0; cursor: pointer; }
.ms-item span { flex: 1; }
.ms-item .ms-cnt { font-size: 11px; color: var(--text-tertiary); }
.ms-foot {
  border-top: 1px solid var(--border-color);
  margin-top: 4px;
  padding-top: 6px;
  display: flex;
  gap: 12px;
  font-size: 12px;
}
.ms-foot a { color: var(--primary); cursor: pointer; text-decoration: none; }
.ms-foot a:hover { text-decoration: underline; }

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.modal.modal-lg { max-width: 1100px; }
.modal.modal-sm { max-width: 500px; }

/* 全屏弹窗（跟页面一样大，无悬浮感，但保留 sidebar+topbar 可见） */
.overlay-fullscreen {
  padding: 0 !important;
  background: #f5f6f8 !important;
  align-items: stretch !important;
  /* 只覆盖 main-area 区域：sidebar 右边、topbar 下边 */
  left: var(--sidebar-width) !important;
  top: var(--header-height) !important;
  right: 0 !important;
  bottom: 0 !important;
}
.modal-fullscreen {
  max-width: 100% !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.modal-fullscreen .modal-header {
  flex-shrink: 0;
}
.modal-fullscreen .modal-body {
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding: 20px 24px;
}
.modal-fullscreen .modal-footer {
  flex-shrink: 0;
}
.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}
.modal-header .close { margin-left: auto; cursor: pointer; color: var(--text-tertiary); font-size: 20px; border: none; background: none; }
.modal-header .close:hover { color: var(--text-main); }
.modal-body { padding: 24px; max-height: 65vh; overflow-y: auto; }
.modal-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 标签页 */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}
.tab {
  padding: 10px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-size: 14px;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .badge { margin-left: 6px; background: var(--danger); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 10px; }

/* 下拉搜索 */
.dropdown-search {
  position: relative;
}
.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 10;
  display: none;
}
.dropdown-list.show { display: block; }
.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.dropdown-item:hover { background: var(--primary-light); }
.dropdown-item.active { background: var(--primary); color: #fff; }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state .text { font-size: 14px; }

/* 行内按钮组 */
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }

/* 订单详情操作按钮栏 */
.order-action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #f8f9fa;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.15s;
  white-space: nowrap;
}
.action-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.action-pill .action-icon { font-size: 15px; line-height: 1; }

/* 明细表体 */
.items-table th { background: #fafafa; }
.items-table .item-row td { vertical-align: top; }
.add-item-btn {
  margin: 12px 0;
  padding: 8px;
  width: 100%;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  background: #fafafa;
  cursor: pointer;
  color: var(--primary);
  font-size: 14px;
}
.add-item-btn:hover { border-color: var(--primary); background: var(--primary-light); }

/* 行程明细紧凑表格 */
.items-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}
.items-summary-table th {
  background: #fafafa;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.items-summary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text-main);
}
.items-summary-table tbody tr:hover { background: var(--bg-hover); }
.items-summary-table .col-idx { width: 40px; color: var(--text-tertiary); text-align: center; }
.items-summary-table .col-time { white-space: nowrap; }
.items-summary-table .col-location { white-space: nowrap; }
.items-summary-table .col-type { white-space: nowrap; }
.items-summary-table .col-amount { text-align: right; white-space: nowrap; font-weight: 600; }
.items-summary-table .col-china-time { white-space: nowrap; color: var(--primary); }
.items-summary-table .col-actions { text-align: right; white-space: nowrap; width: 130px; }
.items-summary-table .row-empty td {
  text-align: center;
  color: var(--text-tertiary);
  padding: 32px 0;
}
.items-summary-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fafafa;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border-top: 1px solid var(--border-color);
}
.items-summary-footer .total-label { font-size: 13px; color: var(--text-secondary); }
.items-summary-footer .total-value { font-size: 18px; font-weight: 700; color: var(--primary); }
.items-summary-footer .item-count { font-size: 13px; color: var(--text-tertiary); margin-left: 8px; }

/* 行程编辑模态框内的紧凑表单 */
.item-edit-form .form-row { gap: 12px; margin-bottom: 12px; }
.item-edit-form .form-group label { font-size: 12px; margin-bottom: 4px; }
.item-edit-form .form-group { min-width: 180px; }

/* 多日包车每日行程录入 */
.md-itinerary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: #f9fafb;
  border: 1px solid var(--border-color);
  transition: border-color 0.15s;
}
.md-itinerary-row:hover { border-color: var(--primary); }
.md-itinerary-row .md-day-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 100px;
}
.md-itinerary-row .md-day-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.md-itinerary-input { flex: 1; }

/* 行程路线显示 */
.route-display { font-size: 12px; line-height: 1.4; }
.route-display .route-arrow { color: var(--text-tertiary); margin: 0 2px; }
.route-display .itinerary-text { color: var(--text-secondary); }

/* 收支记录 */
.record-list { list-style: none; }
.record-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.record-item:last-child { border-bottom: none; }
.record-item .info { flex: 1; }
.record-item .info .title { font-weight: 500; }
.record-item .info .meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.record-item .amount { font-weight: 600; font-size: 15px; }
.record-item .amount.in { color: var(--success); }
.record-item .amount.out { color: var(--danger); }

/* 预警卡片 */
.alert-banner {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d48806;
  font-size: 12px;
}
.alert-banner.dismissible {
  padding-right: 10px;
}
.alert-banner-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #d48806;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
}
.alert-banner-close:hover { opacity: 1; }

/* 利润显示 */
.profit-positive { color: var(--success); font-weight: 600; }
.profit-negative { color: var(--danger); font-weight: 600; }

/* 订单池成本列 */
.cost-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.cost-amount { cursor: pointer; }
.invoice-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: all .15s ease;
  border: 1px solid transparent;
}
.invoice-tag.invoice-on {
  background: rgba(22, 119, 255, 0.1);
  color: #1677ff;
  border-color: rgba(22, 119, 255, 0.3);
}
.invoice-tag.invoice-on:hover { background: rgba(22, 119, 255, 0.18); }
.invoice-tag.invoice-off {
  background: rgba(0, 0, 0, 0.04);
  color: #8c8c8c;
  border-color: rgba(0, 0, 0, 0.12);
}
.invoice-tag.invoice-off:hover { background: rgba(22, 119, 255, 0.08); color: #1677ff; border-color: rgba(22, 119, 255, 0.3); }
.pay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 11px;
  color: #fff;
  background: var(--danger);
  border-radius: 9px;
  cursor: pointer;
  line-height: 1;
  font-weight: 600;
}
.pay-badge:hover { background: #ff7875; transform: scale(1.05); }
.paid-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--success);
  background: rgba(82, 196, 26, 0.1);
  border: 1px solid rgba(82, 196, 26, 0.3);
  border-radius: 9px;
  line-height: 1.4;
  white-space: nowrap;
}

/* 成本卡片（成本录入/订单详情） */
.cost-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.cost-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary, #fafafa);
  gap: 12px;
}
.cost-card-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cost-card-type { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.cost-card-meta { font-size: 12px; color: var(--text-secondary); }
.cost-card-amounts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cost-card-amt { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.cost-tag {
  display: inline-flex;
  padding: 1px 7px;
  font-size: 11px;
  border-radius: 9px;
  line-height: 1.6;
  white-space: nowrap;
}
.cost-tag-paid { color: var(--success); background: rgba(82,196,26,0.1); }
.cost-tag-refunded { color: var(--danger); background: rgba(245,34,45,0.08); }
.cost-tag-unpaid { color: var(--warning); background: rgba(250,173,20,0.1); }
.cost-tag-clear { color: var(--success); background: rgba(82,196,26,0.1); font-weight: 600; }
.cost-payments { padding: 4px 14px 8px; }
.payment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 13px;
}
.payment-row:last-child { border-bottom: none; }
.payment-row.payment-done { opacity: 0.55; }
.pay-date { min-width: 85px; color: var(--text-secondary); }
.pay-account { min-width: 80px; }
.pay-amount { color: var(--success); font-weight: 500; min-width: 80px; }
.pay-refunded { color: var(--danger); font-size: 12px; }
.pay-remark { color: var(--text-secondary); font-size: 12px; flex: 1; }
.refund-mini-btn {
  margin-left: auto;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--danger);
  background: rgba(245,34,45,0.08);
  border: 1px solid rgba(245,34,45,0.2);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.refund-mini-btn:hover {
  background: rgba(245,34,45,0.15);
  border-color: rgba(245,34,45,0.4);
}
.cost-del-btn {
  margin-left: auto;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.cost-del-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(245,34,45,0.06);
}
.refund-done-tag {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary, #999);
  white-space: nowrap;
}
/* 收款记录里的退款按钮：紧跟在金额右侧 */
.record-item .refund-mini-btn { margin-left: 12px; }
.record-item .refund-done-tag { margin-left: 12px; }
.record-item .amount { margin-right: 0; }
.cost-no-payments {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-tertiary, #999);
}

/* 静态值显示（退款弹窗） */
.static-value {
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-secondary, #fafafa);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 4px);
}

/* 复选框 */
.checkbox-wrap { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox-wrap input { width: 16px; height: 16px; cursor: pointer; }

/* 工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.toolbar-title { font-size: 17px; font-weight: 700; color: var(--text-main); }

/* 详情信息网格（询价/报价单详情） */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.detail-item { background: #fafafa; border: 1px solid var(--border-color); border-radius: 6px; padding: 10px 12px; }
.detail-item span { display: block; font-size: 12px; color: var(--text-tertiary); margin-bottom: 4px; }
.detail-item b { display: block; font-size: 14px; color: var(--text-main); word-break: break-all; }

/* 链接 */
.link { color: var(--primary); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* 提示 */
.hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* 分隔线 */
.divider { height: 1px; background: var(--border-color); margin: 16px 0; }

/* 内联表单 */
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .form-group { flex: 1; min-width: 120px; }

/* 设置页面 - 左侧导航 + 右侧详情 */
.settings-layout {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 420px;
}
.settings-nav {
  width: 200px;
  flex-shrink: 0;
  background: #fafbfc;
  border-right: 1px solid var(--border-color);
  padding: 8px 0;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
}
.settings-nav-item:hover { background: #f0f5ff; color: var(--primary); }
.settings-nav-item.active {
  background: #fff;
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.settings-nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }
.settings-nav-item .nav-count {
  margin-left: auto;
  background: #e8e8e8;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.settings-nav-item.active .nav-count { background: var(--primary-light); color: var(--primary); }

.settings-content {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.settings-content-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}
.settings-content-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.settings-content-header .header-count {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
}
.settings-content-header .spacer { flex: 1; }

.settings-search-box {
  position: relative;
  width: 220px;
}
.settings-search-box input {
  width: 100%;
  padding: 6px 12px 6px 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.settings-search-box input:focus { outline: none; border-color: var(--primary); }
.settings-search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
}

.settings-add-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.settings-add-bar input { flex: 1; }

.settings-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.settings-data-table th {
  background: #fafafa;
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}
.settings-data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f5;
  color: var(--text-main);
}
.settings-data-table tbody tr:hover { background: var(--bg-hover); }
.settings-data-table .row-index {
  color: var(--text-tertiary);
  font-size: 13px;
  width: 50px;
}
.settings-data-table .row-name { font-weight: 500; }
.settings-data-table .row-actions { text-align: right; width: 120px; white-space: nowrap; }
.settings-data-table .edit-input {
  padding: 4px 8px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 100%;
  max-width: 300px;
}
.settings-empty-row td {
  text-align: center;
  color: var(--text-tertiary);
  padding: 40px 0;
  font-size: 14px;
}

/* 车型库 */
.vc-section {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.vc-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vc-section-title .spacer { flex: 1; }

.vc-categories { display: flex; flex-wrap: wrap; gap: 10px; }
.vc-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  transition: all 0.15s;
}
.vc-cat-chip:hover { border-color: var(--primary); color: var(--primary); }
.vc-cat-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.vc-cat-count { background: rgba(0,0,0,0.08); border-radius: 10px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.vc-cat-chip.active .vc-cat-count { background: rgba(255,255,255,0.25); }
.vc-cat-add { border-style: dashed; color: var(--text-tertiary); }
.vc-cat-add:hover { color: var(--primary); border-color: var(--primary); }

.vc-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.vc-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s;
}
.vc-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.vc-card-imgs { display: flex; gap: 4px; padding: 8px 8px 0; }
.vc-img {
  flex: 1;
  height: 64px;
  border-radius: 4px;
  background-color: #f0f1f3;
  background-size: cover;
  background-position: center;
  position: relative;
}
.vc-img[data-action] { cursor: pointer; }
.vc-img-empty { border: 1px dashed #d9d9d9; background-color: #fafafa; }
.vc-img-copy {
  position: absolute;
  bottom: 3px;
  right: 3px;
  padding: 1px 5px;
  font-size: 11px;
  line-height: 1.4;
  border: none;
  border-radius: 4px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.vc-img:hover .vc-img-copy { opacity: 1; }
.vc-img-copy:hover { background: rgba(0,0,0,0.8); }

/* 图片大图预览 */
.vlib-preview {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.vlib-preview-img {
  width: 82vw;
  height: 72vh;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.vlib-preview-bar { display: flex; gap: 12px; }
.vc-card-body { padding: 10px 12px 12px; }
.vc-card-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.vc-card-meta { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.vc-seats { background: var(--primary-light); color: var(--primary); padding: 1px 8px; border-radius: 10px; }
.vc-remark { color: var(--text-tertiary); }
.vc-card-actions { display: flex; justify-content: flex-end; gap: 4px; border-top: 1px solid var(--bg-tertiary); padding-top: 6px; }
.vc-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-tertiary);
  padding: 48px 0;
  font-size: 14px;
}

/* 车型表单 */
.vc-form { display: flex; flex-direction: column; gap: 14px; }
.vc-upload-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.vc-upload-item {
  position: relative;
  width: 88px;
  height: 88px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.vc-upload-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-upload-empty {
  border: 1px dashed #d9d9d9;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vc-plus { font-size: 22px; color: #c0c4cc; line-height: 1; }
.vc-uploading { font-size: 12px; color: var(--primary); }
.vc-img-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.vc-img-del:hover { background: rgba(0,0,0,0.8); }
.vc-upload-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }

/* ===== 车型库（独立页签，左分类 / 右车型） ===== */
.vlib-layout {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 460px;
}
.vlib-side {
  width: 220px;
  flex-shrink: 0;
  background: #fafbfc;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.vlib-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
.vlib-side-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.vlib-side-tip {
  padding: 0 16px 10px;
  font-size: 12px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-color);
}
.vlib-cats { flex: 1; overflow-y: auto; padding: 8px 0; }

/* 分类树（多级）：每行 = toggle + 分类按钮 */
.vlib-cat-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px 2px 0;
}
.vlib-cat-toggle, .vlib-cat-toggle-empty {
  width: 18px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 10px;
  flex-shrink: 0;
  padding: 0;
}
.vlib-cat-toggle:hover { color: var(--primary); }
.vlib-cat-toggle-empty { cursor: default; opacity: 0.4; }

.vlib-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.15s;
}
.vlib-cat:hover { background: #f0f5ff; color: var(--primary); }
.vlib-cat.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.vlib-cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vlib-cat-count {
  background: #e8e8e8;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.vlib-cat.active .vlib-cat-count { background: rgba(255,255,255,0.25); color: #fff; }
.vlib-cats-empty { padding: 24px 16px; font-size: 13px; color: var(--text-tertiary); text-align: center; }

/* 右侧主体 */
.vlib-main { flex: 1; padding: 20px 24px; display: flex; flex-direction: column; min-width: 0; }

/* 面包屑 */
.vlib-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-tertiary);
  min-height: 24px;
}
.vlib-crumb {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.vlib-crumb:hover { background: #f0f5ff; color: var(--primary); }
.vlib-crumb.current { color: var(--primary); font-weight: 600; cursor: default; background: #eef4ff; }
.vlib-crumb-sep { color: var(--text-tertiary); padding: 0 2px; }

.vlib-main-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.vlib-main-title { display: flex; align-items: baseline; gap: 10px; }
.vlib-main-title h3 { font-size: 16px; font-weight: 600; margin: 0; }
.vlib-main-title .vlib-count { font-size: 13px; color: var(--text-tertiary); }
.vlib-main-head .spacer { flex: 1; }

.vlib-main-body { flex: 1; overflow-y: auto; }
.vlib-section { margin-bottom: 18px; }
.vlib-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

/* 子分类卡片网格 */
.vlib-children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.vlib-child-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s;
  cursor: pointer;
}
.vlib-child-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(29,78,216,0.08); }
.vlib-child-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.vlib-child-meta { font-size: 12px; color: var(--text-tertiary); }
.vlib-child-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}
.vlib-child-actions .btn { flex: 1; }

.vlib-models {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  overflow-y: auto;
}
/* 车型卡片图片在车型库里放大展示 */
.vlib-models .vc-img { height: 120px; }

/* 响应式：窄屏时分类与车型上下堆叠 */
@media (max-width: 768px) {
  .vlib-layout { flex-direction: column; }
  .vlib-side { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); max-height: 220px; }
  .vlib-cats { display: block; padding: 8px; }
  .vlib-cat { border-radius: 6px; padding: 8px 10px; }
}

.modal.modal-md { max-width: 680px; }

/* 数据管理卡片 */
.data-mgmt-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 20px 24px;
  margin-top: 16px;
}
.data-mgmt-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}
.data-mgmt-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.data-mgmt-info {
  margin-top: 12px;
  padding: 12px 16px;
  background: #f6f8fa;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.export-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
}
.export-field-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.export-field-item:hover {
  border-color: var(--primary);
  background: rgba(24,144,255,0.04);
}
.export-field-item input[type="checkbox"] {
  cursor: pointer;
}
@media (max-width: 600px) {
  .export-fields-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-area { margin-left: 0; }
  .menu-toggle { display: block; }
  .topbar { padding: 0 12px; }
  .content { padding: 12px; }
  .card-header { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .form-group { min-width: 100%; }
  .settings-layout { flex-direction: column; }
  .settings-nav { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); display: flex; overflow-x: auto; }
  .settings-nav-item { border-left: none; border-bottom: 3px solid transparent; }
  .settings-nav-item.active { border-left: none; border-bottom-color: var(--primary); }
  .settings-search-box { width: 100%; }
}

/* 打印 */
@media print {
  .sidebar, .topbar, .filter-bar, .toolbar { display: none; }
  .content { padding: 0; }
}

/* ===== Tab 分页签 ===== */
.tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-color, #e8e8e8);
  margin-bottom: 16px;
  padding: 0 4px;
  flex-wrap: wrap;
}
.tabs-nav .tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary, #666);
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  top: 2px;
}
.tabs-nav .tab-btn:hover {
  color: var(--primary, #1677ff);
}
.tabs-nav .tab-btn.active {
  color: var(--primary, #1677ff);
  border-bottom-color: var(--primary, #1677ff);
  font-weight: 600;
}
.tabs-nav .tab-count {
  display: inline-block;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--bg-tertiary, #f5f5f5);
  color: var(--text-secondary, #666);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}
.tabs-nav .tab-btn.active .tab-count {
  background: var(--primary-light, #e6f4ff);
  color: var(--primary, #1677ff);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== 订单明细表 - 直接编辑模式（参考金蝶） ===== */
.items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary, #fafafa);
  border: 1px solid var(--border-color, #f0f0f0);
  border-radius: 6px;
}
.items-toolbar-left { color: var(--text-secondary, #666); font-size: 12px; }
.items-toolbar-right { display: flex; gap: 8px; }

/* 直接编辑表格：所有字段都是input/select */
table.items-edit-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1180px;
  font-size: 12px;
  table-layout: auto;
}
table.items-edit-table th {
  background: var(--bg-tertiary, #fafafa);
  font-weight: 600;
  color: var(--text-secondary, #666);
  padding: 8px 6px;
  text-align: left;
  border-bottom: 2px solid var(--border-color, #e8e8e8);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.items-edit-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border-color, #f0f0f0);
  vertical-align: middle;
}
table.items-edit-table tr:hover td {
  background: #fafbff;
}
table.items-edit-table td.item-del {
  text-align: center;
  width: 32px;
  padding: 4px 0;
}
table.items-edit-table td.item-detail {
  text-align: center;
  width: 50px;
}
table.items-edit-table td.numeric { text-align: right; }
table.items-edit-table input,
table.items-edit-table select {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 3px;
  outline: none;
  font-family: inherit;
  color: inherit;
  transition: all 0.15s;
  box-sizing: border-box;
}
table.items-edit-table input[type=number] { text-align: right; }
table.items-edit-table input:hover,
table.items-edit-table select:hover {
  border-color: var(--border-color, #e8e8e8);
  background: #fff;
}
table.items-edit-table input:focus,
table.items-edit-table select:focus {
  border-color: var(--primary, #1677ff);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}
table.items-edit-table .item-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  transition: all 0.15s;
  padding: 0;
}
table.items-edit-table .item-del-btn:hover {
  background: #fff1f0;
  color: #ff4d4f;
}
table.items-edit-table .item-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid var(--border-color, #e8e8e8);
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  color: var(--text-secondary, #666);
}
table.items-edit-table .item-detail-btn:hover {
  background: var(--primary-light, #e6f4ff);
  border-color: var(--primary, #1677ff);
  color: var(--primary, #1677ff);
}
table.items-edit-table tr.is-new-row td {
  background: #f6ffed;
}
table.items-edit-table tr.is-saving td {
  background: #f0f5ff !important;
}
table.items-edit-table tr td.cell-saved {
  animation: cellSavedFlash 1s ease;
}
@keyframes cellSavedFlash {
  0%   { background: #b7eb8f; }
  100% { background: transparent; }
}

/* ===== 明细表 + / − 操作列 ===== */
.items-edit-table .op-col {
  width: 50px;
  text-align: center;
  white-space: nowrap;
  padding: 2px 4px !important;
  background: #fafbfc;
  position: sticky;
  left: 0;
  z-index: 1;
}
.items-edit-table .op-col .op-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  margin: 0 1px;
  color: #555;
  vertical-align: middle;
  transition: all 0.12s;
}
.items-edit-table .op-col .op-btn:hover { background: #f0f7ff; color: #1677ff; border-color: #91caff; }
.items-edit-table .op-col .op-btn.op-add:hover { background: #f0fff4; color: #16a34a; border-color: #95de64; }
.items-edit-table .op-col .op-btn.op-del { border-color: #ffccc7; color: #ff7875; }
.items-edit-table .op-col .op-btn.op-del:hover { background: #fff1f0; color: #ff4d4f; border-color: #ffa39e; }
/* 第一行（表头）的操作列也固定 */
.items-edit-table thead .op-col {
  background: #f0f0f0;
  position: sticky;
  left: 0;
  z-index: 3;
}

/* ===== v86.5：询价单专用「紧凑」明细表（单行表头 + 窄列）===== */
.inquiry-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}
table.items-edit-table.inquiry-items-table {
  min-width: 1240px;
  font-size: 11px;
}
table.items-edit-table.inquiry-items-table th,
table.items-edit-table.inquiry-items-table td {
  padding: 3px 4px;
}
table.items-edit-table.inquiry-items-table th {
  font-size: 11px;
  padding: 5px 4px;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
table.items-edit-table.inquiry-items-table input,
table.items-edit-table.inquiry-items-table select {
  padding: 2px 4px;
  font-size: 11px;
  min-height: 22px;
}
table.items-edit-table.inquiry-items-table input:focus,
table.items-edit-table.inquiry-items-table select:focus {
  box-shadow: 0 0 0 2px rgba(22,119,255,0.15);
}
table.items-edit-table.inquiry-items-table tbody tr:hover td {
  background: #f5f9ff;
}
table.items-edit-table.inquiry-items-table .op-col {
  width: 52px;
  padding: 2px 4px !important;
}
table.items-edit-table.inquiry-items-table .op-col .op-btn {
  width: 18px;
  height: 18px;
  font-size: 12px;
}

/* 新增分录工具栏 */
.items-edit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #fafbfc;
  border-bottom: 1px solid #f0f0f0;
}
.items-edit-toolbar .toolbar-info { font-size: 12px; color: #888; }
.items-edit-toolbar .btn-add-item {
  background: #1677ff;
  color: #fff;
  border: none;
  padding: 4px 14px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}
.items-edit-toolbar .btn-add-item:hover { background: #4096ff; }

/* ===== 登录页 ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 380px;
  max-width: 90vw;
  overflow: hidden;
}
.login-header {
  text-align: center;
  padding: 40px 30px 20px;
  border-bottom: 1px solid #f0f0f0;
}
.login-logo span {
  font-size: 48px;
  display: inline-block;
  margin-bottom: 12px;
}
.login-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 6px;
}
.login-header p {
  font-size: 14px;
  color: #9ca3af;
}
.login-form {
  padding: 30px 30px 20px;
}
.login-field {
  margin-bottom: 18px;
}
.login-field label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 500;
}
.login-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}
.login-input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22,119,255,0.12);
}
.login-error {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  color: #ff4d4f;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}
.login-btn {
  width: 100%;
  padding: 12px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 2px;
}
.login-btn:hover { background: #0958d9; }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-footer {
  text-align: center;
  padding: 16px 30px 24px;
  font-size: 12px;
  color: #bbb;
}
.login-qrcode {
  padding: 0 30px 20px;
  text-align: center;
  border-top: 1px dashed #f0f0f0;
  margin-top: 4px;
}
.qrcode-title {
  font-size: 12px;
  color: #9ca3af;
  margin: 14px 0 8px;
}
.qrcode-wrap {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  line-height: 0;
}
.qrcode-wrap img,
.qrcode-wrap canvas {
  display: block;
  width: 128px;
  height: 128px;
}
.qrcode-url {
  font-size: 11px;
  color: #bbb;
  margin-top: 8px;
  word-break: break-all;
  user-select: all;
  cursor: pointer;
}

/* ===== 顶栏用户信息 ===== */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-user .user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

/* ===== 表头字段设置（拖拽排序 + 显示/隐藏） ===== */
.field-cfg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 2px;
}
.field-cfg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e8e8e8);
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.field-cfg-row:hover {
  border-color: var(--primary, #1677ff);
  box-shadow: 0 2px 8px rgba(22,119,255,0.08);
}
.field-cfg-row.dragging {
  opacity: 0.45;
  border-style: dashed;
}
.field-cfg-row .drag-handle {
  cursor: grab;
  color: var(--text-tertiary, #999);
  font-size: 16px;
  line-height: 1;
  user-select: none;
}
.field-cfg-row .field-cfg-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-main, #333);
}
.field-cfg-row .switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary, #666);
  cursor: pointer;
  user-select: none;
}
.field-cfg-row .switch input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary, #1677ff);
}
.field-cfg-row .switch input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}


/* ===== AI 助手模块 ===== */
.ai-assistant-shell {
  display: flex;
  height: calc(100vh - 130px);
  min-height: 600px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.ai-sidebar {
  width: 240px;
  flex: 0 0 240px;
  border-right: 1px solid var(--border);
  background: #fafbfc;
  padding: 12px;
  overflow-y: auto;
}
.ai-chat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-chat-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.ai-chat-item:hover {
  border-color: var(--primary);
  background: #fff;
}
.ai-chat-item.active {
  border-color: var(--primary);
  background: #e6f4ff;
}
.ai-chat-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.ai-chat-item-preview {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.ai-chat-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
  background: #f9fafb;
}
.ai-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}
.ai-msg {
  display: flex;
  margin-bottom: 14px;
  animation: fadeIn 0.3s ease;
}
.ai-msg-user { justify-content: flex-end; }
.ai-msg-assistant { justify-content: flex-start; }
.ai-msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.ai-msg-user .ai-msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg-assistant .ai-msg-bubble {
  background: #fff;
  color: #1f2937;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.ai-apply-card {
  margin-top: 8px;
  padding: 12px;
  border: 1px dashed var(--primary);
  background: #f0f7ff;
  border-radius: 8px;
  max-width: 75%;
}
.ai-quickbar {
  display: flex;
  gap: 6px;
  padding: 8px 18px 4px;
  border-top: 1px solid var(--border);
  background: #fff;
  flex-wrap: wrap;
}
.ai-quickbar .btn { font-size: 12px; }
.ai-input-area {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ===== v142：AI 助手图片消息 ===== */
/* 待发送图片缩略图条（无图时由 JS 设 display:none，不占高度） */
.ai-attach-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-attach-item {
  position: relative;
  width: 62px;
  height: 62px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}
.ai-attach-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-attach-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.ai-attach-del:hover { background: rgba(220, 38, 38, 0.9); }
.ai-attach-tip {
  font-size: 11px;
  color: var(--text-tertiary);
}
/* 拖拽悬停高亮，给出"能放这儿"的反馈 */
.ai-input-area.ai-drag-over {
  background: #eef2ff;
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
}
/* 已发送消息气泡内的图片 */
.ai-msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.ai-msg-image {
  display: block;
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.ai-msg-image img {
  max-width: 150px;
  max-height: 150px;
  display: block;
  object-fit: cover;
}
/* 历史记录里图片内容不落盘，用一行说明占位 */
.ai-msg-img-note {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 4px;
}
/* ===== v143：行程单预览「就地编辑」=====
   单元格本身是行内样式上色的，所以高亮不能靠 background 覆盖，
   统一用 box-shadow 画内描边（不受行内样式影响，也不会挤动表格布局）。 */
.sheet-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sheet-dirty {
  font-size: 12px;
  color: var(--text-tertiary);
}
.sheet-dirty.on {
  color: #b45309;
  font-weight: 600;
}
.sheet-edit-hint {
  font-size: 12px;
  color: #64748b;
  line-height: 1.9;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.sheet-edit-host td.sheet-cell,
.sheet-edit-host td.sheet-merged-cell {
  cursor: text;
}
.sheet-edit-host td.sheet-cell:hover,
.sheet-edit-host td.sheet-merged-cell:hover {
  box-shadow: inset 0 0 0 2px #bfdbfe;
}
.sheet-edit-host td.editing {
  padding: 2px !important;
  box-shadow: inset 0 0 0 2px #2563eb;
}
.sheet-cell-input {
  width: 100%;
  min-height: 30px;
  border: 0;
  outline: none;
  resize: vertical;
  overflow: hidden;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: #1f2937;
  background: transparent;
  padding: 3px 2px;
  box-sizing: border-box;
}
.sheet-row-del {
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 4px 5px;
  border-radius: 4px;
  color: #94a3b8;
}
.sheet-row-del:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}
.sheet-edit-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 10px;
  line-height: 1.7;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blinkCaret {
  0%, 50%   { opacity: 1; }
  50.01%,100%{ opacity: 0; }
}
.ai-msg-assistant .ai-msg-bubble {
  position: relative;
}
.ai-msg-assistant .ai-msg-bubble.is-streaming::after {
  content: '▍';
  display: inline-block;
  margin-left: 2px;
  color: var(--primary);
  animation: blinkCaret 0.9s steps(2, start) infinite;
  font-weight: 700;
}
.ai-msg {
  /* 提升合成层，避免输入时整页 reflow 闪烁 */
  contain: layout paint;
}
@media (max-width: 900px) {
  .ai-assistant-shell {
    flex-direction: column;
    height: calc(100vh - 100px);
  }
  .ai-sidebar {
    width: 100%;
    flex: 0 0 auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .ai-msg-bubble, .ai-apply-card { max-width: 92%; }
}

/* ===========================================================
 * 询价管理（v86）
 * =========================================================== */
.iq-tabs-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 0;
  margin: 16px 0 12px;
  flex-wrap: wrap;
}
.iq-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: background .15s, color .15s;
  position: relative;
  bottom: -1px;
}
.iq-tab:hover { background: var(--hover-bg, #f1f5f9); color: var(--text-primary); }
.iq-tab.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 -1px 0 0 var(--border), 1px 0 0 0 var(--border), -1px 0 0 0 var(--border);
}
.iq-tab .iq-tab-count {
  display: inline-block;
  min-width: 22px;
  padding: 0 7px;
  height: 18px;
  line-height: 18px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.iq-tab.active .iq-tab-count {
  background: var(--primary);
  color: #fff;
}

.iq-status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}

.iq-quote-context {
  scrollbar-width: thin;
}

.iq-quote-context > div:last-child { border-bottom: none !important; }

/* 询价单表单样式（复用 .form-group/.form-section/.form-row） */
.iq-tabs-bar + .filter-bar { margin-top: 0; }

@media (max-width: 768px) {
  .iq-tab { padding: 7px 10px; font-size: 13px; }
}

/* ===== 表格列宽 / 行高可拖拽（v91） ===== */

/* 列宽调整手柄：放在 <th> 右侧 */
.resizable-table th {
  position: relative;
}
.resizable-table th .col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
}
.resizable-table th .col-resize-handle:hover,
.resizable-table th .col-resize-handle.dragging {
  background: var(--primary);
  opacity: 0.45;
}
/* 防止列宽拖拽时选中文本 */
.resizable-table.resizing,
.resizable-table.resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* 行高调整手柄：放在 <tr> 底部分隔线处 */
.resizable-table tr.resizable-row {
  position: relative;
}
.resizable-table tr.resizable-row .row-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 6px;
  cursor: row-resize;
  user-select: none;
  z-index: 2;
  display: none;
}
.resizable-table tr.resizable-row:hover .row-resize-handle {
  display: block;
}
.resizable-table tr.resizable-row .row-resize-handle:hover,
.resizable-table tr.resizable-row .row-resize-handle.dragging {
  background: var(--primary);
  opacity: 0.45;
}
.resizable-table.resizing-rows,
.resizable-table.resizing-rows * {
  cursor: row-resize !important;
  user-select: none !important;
}

/* 长文本 input / textarea：聚焦时可横向滚动，避免内容被截断看不清 */
.items-edit-table input[type="text"],
.items-edit-table input:not([type]),
.items-inline-edit-table input[type="text"],
.items-inline-edit-table input:not([type]) {
  /* 默认单行截断显示 */
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
/* 聚焦时允许滚动查看完整内容 + 自动换行 */
.items-edit-table input[type="text"]:focus,
.items-edit-table input:not([type]):focus,
.items-inline-edit-table input[type="text"]:focus,
.items-inline-edit-table input:not([type]):focus {
  text-overflow: clip;
  white-space: normal;
  overflow: auto;
  word-break: break-word;
  background: #fffceb;
  box-shadow: inset 0 0 0 2px var(--primary);
  min-height: 30px;
  height: auto;
}
/* textarea 字段保持可换行显示 */
.items-edit-table textarea,
.items-inline-edit-table textarea {
  white-space: pre-wrap;
  word-break: break-word;
}

/* 字段被手动撑高时，行高撑开 */
.items-edit-table td.row-stretched,
.items-inline-edit-table td.row-stretched {
  height: auto;
}

/* ===========================================================
 * v109：行高可调 +「拉高即换行」
 * 用法：<tr> 上带 data-row-key="稳定标识" data-rh-store="表名"（由 Utils.rowAttrs() 输出）。
 * 平时每行只显示一行（长文本横向省略）；把行下边缘往下拖 → 该行长文本
 * 自动换行显示全文（textarea 控件同时伸展，可直接编辑）。
 * 行高只记在本次会话内存里，刷新/重开页面回到默认单行。
 * =========================================================== */

/* 行高拖拽时的横向指示线（JS 定位） */
.tbl-row-guide {
  position: fixed;
  left: 0;
  height: 2px;
  background: var(--primary);
  opacity: .85;
  z-index: 99999;
  pointer-events: none;
  display: none;
  box-shadow: 0 0 4px rgba(22, 119, 255, .5);
}

/* 行下边缘的“可拖拽”热区提示：光标由 JS 切换为 row-resize */
tbody tr[data-row-key] td {
  box-sizing: border-box;
  vertical-align: top;
}

/* ---- 只读表格：长文本列默认单行省略，拉高后换行显示全文 ---- */
td.cell-wrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}
td.cell-wrap > .cell-clip {
  display: block;
  max-height: 22px;              /* 默认只露一行 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tr.rw-expanded td.cell-wrap,
tr.rw-expanded td.cell-wrap > .cell-clip {
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
  max-height: none;              /* 拉高后完整显示 */
}

/* ---- 编辑表格：可随行高伸展的长文本控件 ---- */
/* 默认只占一行（视觉与普通 input 一致）；行被拉高后由 --rh 变量决定高度，文字自动换行 */
textarea.row-flex {
  display: block;
  width: 100%;
  height: 25px;
  min-height: 25px;
  max-height: none;
  padding: 4px 6px;
  border: 1px solid var(--border-color, var(--border));
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.45;
  color: inherit;
  background: #fff;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
textarea.row-flex:hover { border-color: var(--primary); }
textarea.row-flex:focus {
  outline: none;
  border-color: var(--primary);
  background: #fffceb;
  overflow: auto;
}
/* 行被拉高 → 长文本框跟随长高，可直接编辑查看全文 */
tr[data-rh] textarea.row-flex {
  height: calc(var(--rh) - 9px);
  overflow: auto;
}

/* 拖拽行高期间禁止选中文本 */
body.rw-resizing,
body.rw-resizing * {
  user-select: none !important;
  cursor: row-resize !important;
}

/* ===========================================================
 * 询价管理 UI 重构（v93）
 * 目标：统一走设计令牌（--primary / --text-main / --border-color …），
 *      把原先散落在 enquiry.js 模板里的内联样式收敛成 .inq-* 语义类。
 * 结构：页头 / 状态概览（兼 tab）/ 列表 / 详情 / 报价面板 / 表单
 * =========================================================== */
.inq-page { padding-bottom: 24px; }

/* ---------- 页头 ---------- */
.inq-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #eef4ff 0%, #f8fafd 55%, #fff 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.inq-head-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: #fff;
  border: 1px solid #dce7ff;
  box-shadow: 0 2px 6px rgba(22, 119, 255, 0.12);
}
.inq-head-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.2px;
}
.inq-head-desc {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.inq-head-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  padding-top: 4px;
}

/* ---------- 状态概览（同时作为 tab 切换） ---------- */
.inq-stat-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.inq-stat {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px 12px 17px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  font-family: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, background 0.18s;
}
.inq-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent, #cbd5e1);
  opacity: 0.7;
  transition: width 0.18s, opacity 0.18s;
}
.inq-stat:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #d3dced;
}
.inq-stat.is-active {
  border-color: var(--accent, var(--primary));
  background: var(--accent-bg, #f8fafc);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}
.inq-stat.is-active::before { width: 4px; opacity: 1; }
.inq-stat-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, var(--text-secondary));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inq-stat-count {
  display: block;
  margin-top: 7px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.inq-stat-unit {
  margin-left: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.inq-stat.is-active .inq-stat-count { color: var(--accent, var(--text-main)); }

/* ---------- 列表 ---------- */
.inq-list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.inq-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.inq-table thead th {
  padding: 11px 14px;
  background: #fafbfd;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}
.inq-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.inq-table tbody tr:last-child td { border-bottom: none; }
.inq-table tbody tr { transition: background 0.15s; }
.inq-table tbody tr:hover { background: #f8fafc; }

/* ---------- v132：询价列表「详情列」模式（列项对齐运营跟单，多段行程逐行展开） ---------- */
.inq-table--detail { table-layout: fixed; }
.inq-table--detail thead th { padding: 10px 10px; }
.inq-table--detail tbody td {
  padding: 9px 10px;
  font-size: 12.5px;
  color: var(--text-main);
  vertical-align: top;
  word-break: break-word;
}
.inq-table--detail td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.inq-td-nowrap { white-space: nowrap; font-size: 12px; }
.inq-td-long { font-size: 12px; line-height: 1.55; color: #475569; }
.inq-dash { color: #cbd5e1; }
.inq-amount { font-size: 13px; font-weight: 600; white-space: nowrap; }
.inq-sub { margin-top: 3px; font-size: 11px; color: var(--text-tertiary); }
.inq-cust-mgr { margin-top: 3px; font-size: 11.5px; color: var(--text-secondary); }

/* ---------- v133：多段行程折叠 + 分销商标签 ---------- */
.inq-expand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 3px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.inq-expand:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.inq-expand-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s;
}
.inq-expand.is-open .inq-expand-caret { transform: rotate(180deg); }
.inq-cust-dist {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 7px;
  border-radius: 4px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.7;
}

.inq-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.2px;
}
.inq-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.inq-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.inq-cust-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}
.inq-cust-phone {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.inq-trip-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.inq-chip-type {
  padding: 2px 8px;
  border-radius: 5px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 600;
}
.inq-chip-city {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.inq-chip-flight {
  font-size: 11.5px;
  color: var(--text-secondary);
}
.inq-trip-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}
.inq-trip-more {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}
.inq-trip-empty { font-size: 12.5px; color: var(--text-tertiary); }

.inq-date {
  font-size: 13px;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.inq-follow {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.inq-follow-date {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #475569;
}
.inq-follow-tag {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.inq-follow.is-overdue .inq-follow-date { color: #dc2626; }
.inq-follow.is-overdue .inq-follow-tag { background: #fee2e2; color: #b91c1c; }
.inq-follow.is-today .inq-follow-date { color: #d97706; }
.inq-follow.is-today .inq-follow-tag { background: #fef3c7; color: #92400e; }
.inq-follow.is-future .inq-follow-date { color: #15803d; }
.inq-follow.is-future .inq-follow-tag { background: #dcfce7; color: #166534; }
.inq-follow.tone-muted .inq-follow-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.inq-follow.tone-done .inq-follow-date {
  font-size: 12px;
  font-weight: 500;
  color: #15803d;
}

/* ---------- 行内操作按钮 ---------- */
.inq-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.inq-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: #f4f6f9;
  color: #475569;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.inq-act:hover { background: #e9edf3; color: var(--text-main); }
.inq-act--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 119, 255, 0.28);
}
.inq-act--primary:hover { background: var(--primary-dark); color: #fff; }
.inq-act--success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}
.inq-act--success:hover { background: #dcfce7; color: #166534; }
.inq-act--warn {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.inq-act--warn:hover { background: #fef3c7; color: #92400e; }
.inq-act--info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.inq-act--info:hover { background: #dbeafe; color: #1e40af; }
.inq-act--ghost {
  background: #fff;
  border-color: var(--border-color);
  color: #64748b;
  padding: 5px 9px;
}
.inq-act--ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--primary);
}

/* ---------- 空状态 ---------- */
.inq-empty { padding: 56px 20px; text-align: center; }
.inq-empty-icon { font-size: 44px; line-height: 1; opacity: 0.5; }
.inq-empty-title {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}
.inq-empty-desc {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.7;
}

/* ---------- 详情弹窗 ---------- */
.inq-detail { margin: -4px 0; }
.inq-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 10px;
}
.inq-detail-head .t { font-size: 14px; font-weight: 600; }
.inq-detail-head .d {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}
.inq-block {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
}
.inq-block:last-child { border-bottom: none; }
.inq-block--flush { padding: 0; overflow: hidden; }
.inq-block-title {
  margin-bottom: 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.inq-kv {
  margin-top: 5px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}
.inq-quote-block {
  background: #f5f9ff;
  border-top: 2px dashed #cfe0ff;
}
.inq-quote-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
}
.inq-quote-title .when {
  font-size: 11.5px;
  font-weight: 500;
  color: #5b7cb8;
  font-variant-numeric: tabular-nums;
}
.inq-quote-pre {
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.75;
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
}
.inq-remark {
  font-size: 13px;
  line-height: 1.75;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 报价面板 ---------- */
.inq-quote-head {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.inq-quote-head .l1 { font-size: 13.5px; font-weight: 600; }
.inq-quote-head .l2 {
  margin-top: 5px;
  font-size: 12.5px;
  opacity: 0.88;
  line-height: 1.6;
}
.inq-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}
.inq-label .hint {
  font-weight: 400;
  color: var(--text-tertiary);
}
.inq-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8dee7;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-main);
  background: #fff;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.inq-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
.inq-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin-top: 14px;
}
.inq-note {
  margin-top: 14px;
  padding: 11px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 9px;
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.7;
}

/* ---------- 表单 ---------- */
.inq-form-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.inq-form-title { font-size: 18px; font-weight: 600; color: var(--text-main); }
.inq-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.inq-form-card > .hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}
.inq-form-card > .hd .sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
}
.inq-form-card > .hd .right { margin-left: auto; }
.inq-form-card > .bd { padding: 18px; }
.inq-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}
.inq-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}
.inq-field .req { margin-left: 2px; color: var(--danger); }
.inq-input,
.inq-field input,
.inq-field select,
.inq-field textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #d8dee7;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.inq-field textarea { line-height: 1.7; resize: vertical; }
.inq-input:focus,
.inq-field input:focus,
.inq-field select:focus,
.inq-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
.inq-field-full { grid-column: 1 / -1; }
.inq-actions-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .inq-stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .inq-head { flex-wrap: wrap; }
  .inq-head-actions { margin-left: 0; width: 100%; padding-top: 0; }
  .inq-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inq-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .inq-grid-3, .inq-grid-2 { grid-template-columns: 1fr; }
  .inq-table thead th, .inq-table tbody td { padding: 10px 10px; }
}

/* ==========================================================================
   v172：运营跟单列表「出发地址 / 到达地址 / 包车行程」双击就地编辑（仅管理员）
   - 默认不显示任何输入框，双击才替换成 .tracking-edit-input
   - 悬停提示用 inset box-shadow 画内描边，**不要用 border / background 覆盖**：
     行上已有行内 background（隔单底色），加边框会挤动布局、加背景会打架（v143 定式）
   ========================================================================== */
.tracking-edit-cell { cursor: text; }
.tracking-edit-cell:hover {
  background: rgba(22, 119, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(22, 119, 255, 0.30);
}
.tracking-edit-cell[data-editing="1"] {
  padding: 2px !important;
  background: transparent;
  box-shadow: none;
}
.tracking-edit-input {
  width: 100%;
  min-width: 180px;
  box-sizing: border-box;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.4;
  padding: 4px 6px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  outline: none;
}
textarea.tracking-edit-input { resize: vertical; min-height: 46px; }

/* ===========================================================
 * v173：订单详情弹窗 —— 明细表「表内滚动」+ 表头固定 + 长文本自动折行
 *
 * 背景（用户报障）：一张单行程几十天时明细表很长，滚动条拖到最下面
 *   「表头字段看不到了」。
 *   根因不是没写 sticky —— `table.items-edit-table th` 早就写了
 *   `position: sticky; top: 0`，但它所在的滚动容器是 `.table-wrap`
 *   （`overflow-x: auto` 会让 `overflow-y` 也计算成 auto ⇒ 它成了滚动容器），
 *   而 `.table-wrap` 自己没有高度限制、永远不产生纵向滚动
 *   ⇒ sticky 相对"一个从不滚动的盒子"定位 = 等于没写；
 *   真正的纵向滚动发生在更外层的 `.modal-body`。
 *
 * 做法：把详情弹窗主体改成 flex 列，把**剩余高度**交给表格容器自己滚 ——
 *   ① 表头稳稳吸在表格顶部 ② 纵向滚动条长在表格内部（而不是整页）
 *   ③ 弹窗主体不再需要滚动。
 *
 * ⚠️ 全部规则限定在 `.order-detail-modal`（由 `OrderPool.onDetailModalShow` 挂到 `.modal` 上）
 *    —— 站点里还有两个 AI 助手的全屏弹窗，别把它们一起改了。
 * =========================================================== */
.order-detail-modal .modal-body {
  display: flex;
  flex-direction: column;
}
/* 「表头信息卡片」与「页签导航」保持自然高度，不参与压缩 */
.order-detail-modal .modal-body > .card,
.order-detail-modal .modal-body > .tabs-nav {
  flex: 0 0 auto;
}
/* 页签内容区吃满剩余高度；非明细页签（收款记录 / 成本记录）自己纵向滚动 */
.order-detail-modal .tab-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
/* 明细页签：工具条（⚙️ 列设置）固定，表格容器吃掉剩余高度并自己滚（横竖都在表内） */
.order-detail-modal .tab-pane.active > #itemsTableWrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.order-detail-modal #itemsTableWrap > div:first-of-type { flex: 0 0 auto; }
.order-detail-modal #itemsTableWrap > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
/* 表头吸顶：给不透明底色，并用 inset 阴影画下边框
   （border-collapse: collapse 下 sticky 单元格的 border-bottom 常常不绘制） */
.order-detail-modal table.items-edit-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fafafa;
  box-shadow: inset 0 -1px 0 var(--border-color, #e8e8e8);
}
/* 合计行吸底：同一张表滚很长时，「合计 (N 条)」也一直看得见 */
.order-detail-modal table.items-edit-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #f6ffed;
  box-shadow: inset 0 1px 0 var(--border-color, #e8e8e8);
}

/* ==========================================================================
   v176：运营跟单列表「出发地址 / 到达地址 / 包车行程 / 举牌信息」四列 —— 只显示一行
   背景（用户 2026-10-14 报障）：
     这四列原本是 `max-width:320px` + `word-break:break-all`。一段行程
     （"日期：… 时间：… 接：… 送：… 行程：…"的多行文本）会被折成十几行
     （实测单行 41px → 折行 273px），一张单几十段时整张订单占满一屏 ——
     "折行显示不方便看其他订单"。
   口径（用户选定）：**只显示一行，装不下的隐藏**，完整内容悬停看提示（title）。

   ★ 实现选型（这里踩过一个坑，别改回去）：
     最初写的是 `<td>` 上 `white-space:nowrap` + `overflow:hidden` + `text-overflow:ellipsis`，
     行高确实降下来了，但**把表格从 1430px 撑到 2002px**（改前没有横向滚动条，
     改后要看「订单金额 / 操作」得横向拖 572px —— 换了一种"不方便"）。
     原因：`nowrap` 让单元格的 min-content 变成**整段文字的宽度**，而表格是
     `table-layout:auto`（`table.data-table { width:100% }`）→ 四列各自顶到 `max-width`
     → 17 列 min-content 之和超过容器宽 → 整表被迫横向展开。
     改用内层 div + `-webkit-line-clamp:1`：内容**仍可正常断行**（min-content 很小）
     ⇒ 列宽分配与改前**完全一致**（表格仍是 1430px、无横向滚动），只是纵向只画一行。
     ⚠️ `-webkit-line-clamp` 需要 `display:-webkit-box`，不能直接给 `<td>` 改 display
       （会把 table-cell 布局整个搞坏）⇒ 必须由 `.tracking-clip-row` 这层 div 承担
       （由 `Tracking._clipCellHtml` 产出，渲染与「保存后回写」共用同一出口）。
   ⚠️ 这是「运营跟单」专有。订单详情弹窗 / 新建订单页 / 询价单的长文本**仍保留折行**
     （v173 / v174 的口径，别顺手"统一"，那三处的诉求正好相反：要看全）。
   ========================================================================== */
.tracking-table td.tracking-clip > .tracking-clip-row {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 双击进入就地编辑时，格里的 .tracking-clip-row 会被整体替换成输入框（见 _beginInlineEdit），
   所以不需要在这里"解除单行限制"；输入框自身的宽度/高度由 .tracking-edit-input 决定。 */
