/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-900);
}
.page-header-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}
.page-header-extra { display: flex; gap: 8px; align-items: center; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 语音输入按钮（语音保修/随记：企业微信内录音转文字） */
.voice-input-btn { flex-shrink: 0; }
.voice-input-btn.recording {
  border-color: var(--error, #d64541);
  color: var(--error, #d64541);
  background: rgba(255, 77, 79, 0.06);
  animation: voicePulse 1.2s ease-in-out infinite;
}
.voice-input-btn.transcribing { opacity: 0.7; cursor: wait; }
.voice-status.danger-text { color: var(--error, #d64541); }
@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 69, 65, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(214, 69, 65, 0); }
}
@media (max-width: 768px) {
  .voice-input-btn { min-height: 34px; }
}

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1024px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .stat-cards { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 16px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-info { flex: 1; }
.stat-card-label { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.stat-card-value { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.stat-card-trend { font-size: 11px; margin-top: 4px; }
.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--error); }
.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-card-icon.secondary { background: rgba(33,75,181,0.05); color: var(--secondary); }
.stat-card-icon.success { background: rgba(82,196,26,0.05); color: var(--success); }
.stat-card-icon.warning { background: rgba(250,173,20,0.05); color: var(--warning); }
.stat-card-icon.info { background: rgba(24,144,255,0.05); color: var(--info); }
.stat-card-icon.error { background: rgba(255,77,79,0.05); color: var(--error); }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.card-body { padding: 14px; }
.card-footer { padding: 10px 14px; border-top: 1px solid var(--gray-100); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  background: var(--white);
  color: var(--gray-700);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.5;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 2px 8px; font-size: 12px; }
.btn-xs { padding: 1px 6px; font-size: 11px; line-height: 1.4; }
.btn-lg { padding: 8px 24px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: var(--white);
}
.btn-primary:hover { opacity: 0.9; color: var(--white); }

.btn-danger { border-color: var(--error); color: var(--error); }
.btn-danger:hover { background: var(--error); color: var(--white); }

.btn-ghost {
  border: none;
  background: none;
  color: var(--primary);
  padding: 2px 8px;
}
.btn-ghost:hover { background: var(--primary-bg); }

.btn-link {
  border: none;
  background: none;
  color: var(--primary);
  padding: 0;
}
.btn-link:hover { color: var(--primary-dark); }
.btn-link:disabled { color: var(--gray-400); cursor: not-allowed; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
}
.tag-default { background: var(--gray-100); color: var(--gray-600); }
.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-secondary { background: rgba(33,75,181,0.05); color: var(--secondary); }
.tag-success { background: rgba(82,196,26,0.05); color: var(--success); }
.tag-warning { background: rgba(250,173,20,0.05); color: var(--warning); }
.tag-error { background: rgba(255,77,79,0.05); color: var(--error); }
.tag-info { background: rgba(24,144,255,0.05); color: var(--info); }
.tag-processing { background: rgba(22,119,255,0.05); color: var(--processing); }
.tag-cyan { background: rgba(19,194,194,0.05); color: var(--cyan); }
.tag-purple { background: rgba(114,46,209,0.05); color: var(--purple); }
.tag-gold { background: rgba(250,173,20,0.05); color: var(--gold); }
.tag-blue { background: rgba(22,119,255,0.05); color: var(--processing); }
.tag-orange { background: rgba(250,173,20,0.05); color: var(--warning); }
.tag-red { background: rgba(255,77,79,0.05); color: var(--error); }
.tag-green { background: rgba(82,196,26,0.05); color: var(--success); }

/* Tables */
.data-table-wrapper {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead { background: var(--gray-50); }
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table .actions { white-space: nowrap; }

/* GESS 列表页紧凑表格（模板用 class="table"） */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
  background: var(--gray-50);
}
.table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--gray-50); }
.table td .btn { padding: 2px 8px; font-size: 12px; }
.table-striped tbody tr:nth-child(odd) { background: var(--gray-50); }
.table-striped tbody tr:nth-child(odd):hover { background: var(--gray-100); }
.table .nowrap, .table td:last-child { white-space: nowrap; }

/* 服务工单列表：固定列宽，仅生产号允许换行，避免长生产号挤压后续字段 */
.svc-list-table {
  table-layout: fixed;
  min-width: 1400px;
}
.svc-list-table th,
.svc-list-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-list-table th:first-child,
.svc-list-table td:first-child {
  width: 108px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: normal;
}
.svc-list-table th:nth-child(2), .svc-list-table td:nth-child(2) { width: 260px; }
.svc-list-table th:nth-child(3), .svc-list-table td:nth-child(3) { width: 190px; }
.svc-list-table th:nth-child(4), .svc-list-table td:nth-child(4) { width: 90px; }
.svc-list-table th:nth-child(5), .svc-list-table td:nth-child(5) { width: 125px; }
.svc-list-table th:nth-child(6), .svc-list-table td:nth-child(6) { width: 125px; }
.svc-list-table th:nth-child(7), .svc-list-table td:nth-child(7) { width: 115px; }
.svc-list-table th:nth-child(8), .svc-list-table td:nth-child(8) { width: 160px; }
.svc-list-table th:nth-child(9), .svc-list-table td:nth-child(9) { width: 120px; }
.svc-list-table th:nth-child(10), .svc-list-table td:nth-child(10) { width: 110px; }

/* Filter Bar */
.filter-bar {
  background: var(--white);
  padding: 10px 14px;
  border-radius: var(--border-radius);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(0,0,0,0.04);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }
/* 筛选栏控件宽度收敛：默认自适应，日期类 150px，长文本搜索框 200px 上限 */
.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 120px;
  max-width: 220px;
  padding: 6px 10px;
}
.filter-bar input[type="date"] { width: 150px; }
.filter-bar input[name="keyword"],
.filter-bar input[placeholder*="搜索"] { width: 200px; }
.filter-bar .btn { padding: 6px 12px; }

/* form-row 筛选/表单行（与 filter-bar 同紧凑规则） */
.form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.form-row .form-input,
.form-row .form-select {
  width: auto;
  min-width: 110px;
  max-width: 220px;
  padding: 6px 10px;
}
.form-row input[type="date"] { width: 150px; }
.form-row input[placeholder*="搜索"],
.form-row input[placeholder*="工单"],
.form-row input[placeholder*="客户"] { width: 160px; }
.form-row .btn { padding: 6px 12px; }
.form-row .form-group { margin-bottom: 0; }

/* 状态快捷筛选 chips（列表页） */
.status-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.status-chips .btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 12px;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label.required::after {
  content: '*';
  color: var(--error);
  margin-left: 2px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 13px;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}
.form-input::placeholder { color: var(--gray-400); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 13px;
  color: var(--gray-600);
}
.pagination-pages { display: flex; gap: 4px; }
.pagination-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  background: var(--white);
  color: var(--gray-700);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.pagination-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.pagination-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* Progress Bar */
.progress-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.progress-bar-fill.primary { background: var(--primary); }
.progress-bar-fill.secondary { background: var(--secondary); }
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.error { background: var(--error); }

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding: 16px 0;
}
.bar-chart-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar-chart-value { font-size: 11px; color: var(--gray-600); margin-bottom: 4px; }
.bar-chart-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}
.bar-chart-label { font-size: 11px; color: var(--gray-500); margin-top: 8px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--white);
  border-radius: 8px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: var(--border-radius);
}
.modal-close:hover { background: var(--gray-100); }
.modal-body { padding: 16px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--gray-100);
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 768px) { .quick-actions { grid-template-columns: repeat(2, 1fr); } }
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
}
.quick-action-card:hover { background: var(--primary-bg); transform: translateY(-2px); }
.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--white);
}
.quick-action-label { font-size: 12px; color: var(--gray-600); }

/* Tabs */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 16px;
}
.tab-item {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* Descriptions */
.desc-row { display: flex; border-bottom: 1px solid var(--gray-100); }
.desc-label {
  width: 120px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--gray-500);
  flex-shrink: 0;
}
.desc-value {
  flex: 1;
  padding: 8px 0;
  font-size: 13px;
  color: var(--gray-800);
}

/* Detail Grid (for detail pages) — 紧凑自适应多列 */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 20px;
}
.detail-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  min-width: 0;
}
.detail-item.detail-span-2 {
  grid-column: span 2;
}
.detail-item.detail-span-full {
  grid-column: 1 / -1;
}
.detail-label {
  font-size: 12px;
  color: var(--gray-500);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 56px;
}
.detail-value {
  font-size: 13px;
  color: var(--gray-800);
  word-break: break-word;
  min-width: 0;
  overflow-wrap: anywhere;
}
/* gess_60：用户要求"字段不要隐藏内容，一眼看到完整内容" —— 详情值一律换行完整显示，
   不再用 ellipsis 截断（原 .nowrap 会隐藏后半段）。日期/编号也允许换行。 */
.detail-value.nowrap {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.detail-value.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
}
/* gess_63（2026-10-28 用户要求）：设备详情"档案信息/客户与位置/运行与状态/质保与时间"
   里的字段要"优先一行展示完，且字段值不换行"。
   做法：这一块网格改成流式 flex —— 字段像标签一样横排，空间够就在一行，不够才整体换行；
   字段值 white-space:nowrap（不换行、不截断）；容器允许横向滚动兜底超长内容。 */
.detail-grid.detail-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  /* 2026-10-28 用户反馈：字段间太拥挤 —— 拉开横向间距并加纵向行距 */
  gap: 12px 48px;
}
.detail-grid.detail-inline .detail-group {
  flex: 0 0 100%;
  margin: 10px 0 2px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--gray-200, #eef0f3);
}
.detail-grid.detail-inline .detail-item {
  padding: 5px 0;
  gap: 10px;
  max-width: 100%;
}
.detail-grid.detail-inline .detail-label {
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
}
/* 2026-10-28 用户补充：短内容保持一行，内容过长时允许换行（不截断、不隐藏） */
.detail-grid.detail-inline .detail-item {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.detail-grid.detail-inline .detail-value,
.detail-grid.detail-inline .detail-value.nowrap {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
/* 窄屏（≤768px）：允许字段换行，避免长地址把卡片撑破 */
@media (max-width: 768px) {
  .detail-grid.detail-inline {
    display: block;
  }
  .detail-grid.detail-inline .detail-item {
    display: flex;
    gap: 8px;
  }
  .detail-grid.detail-inline .detail-value,
  .detail-grid.detail-inline .detail-value.nowrap {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
/* gess_64：表单分组标题（与设备详情"档案信息/客户与位置/运行与状态/质保与时间"一致） */
.form-group-sep {
  margin: 6px 0 2px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--gray-200, #eef0f3);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700, #344054);
}
.form-group-sep:first-child { margin-top: 0; }
/* gess_64：字段填写说明（开发阶段帮助理解"怎么填/为什么空"） */
.detail-hint {
  font-size: 11px;
  color: var(--gray-400, #98a2b3);
  margin-left: 4px;
  white-space: nowrap;
}
/* 2026-10-28 用户反馈：字段名和"未填写说明"字体太像，不好区分。
   空值说明改为浅灰虚线的"占位贴片"（衬底 + 虚线框 + 斜体），与字段名形成明显对比。 */
.detail-empty-hint {
  display: inline-block;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--gray-400, #a8b0bd);
  font-style: italic;
  background: var(--gray-50, #f7f8fa);
  border: 1px dashed var(--gray-200, #e3e6eb);
  border-radius: 4px;
  padding: 0 6px;
  white-space: nowrap;
}
/* 字段名加深一点，与说明拉开层次 */
.detail-grid.detail-inline .detail-label {
  color: var(--gray-700, #475467);
  font-weight: 500;
}
/* 详情字段分组标题（跨整行） */
.detail-group {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.03em;
}
.detail-group::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-300);
  border: 2px solid var(--white);
}
.timeline-item.success::before { background: var(--success); }
.timeline-item.error::before { background: var(--error); }
.timeline-item.warning::before { background: var(--warning); }

/* Badge */
.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.badge-dot.success { background: var(--success); }
.badge-dot.warning { background: var(--warning); }
.badge-dot.error { background: var(--error); }
.badge-dot.processing { background: var(--processing); }
.badge-dot.default { background: var(--gray-400); }

/* ECharts container */
.chart-container { height: 320px; width: 100%; }
.chart-container-sm { height: 240px; width: 100%; }

/* Code block */
.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  padding: 16px;
  border-radius: var(--border-radius);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-md { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.drawer-overlay.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.drawer.show { right: 0; }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.drawer-title { font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }

/* Steps */
.steps { display: flex; margin-bottom: 24px; }
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--gray-200);
}
.step:last-child::before { display: none; }
.step.active::before, .step.done::before { background: var(--primary); }
.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.step.active .step-number { background: var(--primary); color: var(--white); }
.step.done .step-number { background: var(--success); color: var(--white); }
.step-label { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
.step.active .step-label { color: var(--primary); font-weight: 500; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* ========== 任务中心 (Task Center) ========== */
.task-stat-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.task-stat-card { background: #fff; border: 1px solid var(--border-color, #e5e7eb); border-radius: 8px; padding: 14px 12px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 10px; }
.task-stat-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,0.1); }
.task-stat-card.active { border-color: var(--primary); background: #eff6ff; }
.task-stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.task-stat-icon.approval { background: #fef3c7; }
.task-stat-icon.lead { background: #dbeafe; }
.task-stat-icon.opp { background: #fce7f3; }
.task-stat-icon.service { background: #d1fae5; }
.task-stat-icon.payment { background: #fee2e2; }
.task-stat-icon.warranty { background: #fff7ed; }
.task-stat-label { font-size: 12px; color: #6b7280; }
.task-stat-value { font-size: 22px; font-weight: 700; color: #111827; }
.task-tab-nav { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 2px solid var(--border-color, #e5e7eb); padding-bottom: 0; }
.task-tab-btn { padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 13px; color: #6b7280; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.task-tab-btn:hover { color: #374151; }
.task-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.task-list-item { display: flex; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--border-color, #e5e7eb); border-radius: 6px; margin-bottom: 8px; transition: all 0.15s; }
.task-list-item:hover { border-color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.task-list-info { flex: 1; }
.task-list-title { font-size: 14px; font-weight: 500; color: #111827; margin-bottom: 4px; }
.task-list-meta { font-size: 12px; color: #9ca3af; }
.task-list-action { flex-shrink: 0; margin-left: 12px; }
.badge-overdue { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #fee2e2; color: #dc2626; }
.badge-warning { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #fff7ed; color: #ea580c; }
.activity-timeline { max-height: 600px; overflow-y: auto; }
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.activity-item:last-child { border-bottom: none; }
.activity-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary, #2563eb); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.activity-body { flex: 1; }
.activity-desc { font-size: 13px; color: #374151; line-height: 1.4; }
.activity-time { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* ========== 商机看板 (Kanban Board) ========== */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 20px; min-height: calc(100vh - 220px); }
.kanban-column { min-width: 260px; max-width: 320px; flex: 1 0 260px; background: var(--gray-50, #f9fafb); border-radius: 10px; display: flex; flex-direction: column; }
.kanban-col-header { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--border-color, #e5e7eb); }
.kanban-col-title { font-size: 13px; font-weight: 600; color: #374151; }
.kanban-col-count { font-size: 12px; background: #e5e7eb; padding: 2px 8px; border-radius: 10px; color: #6b7280; }
.kanban-col-body { flex: 1; padding: 8px; overflow-y: auto; min-height: 100px; }
.kanban-card { background: #fff; border: 1px solid var(--border-color, #e5e7eb); border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: grab; transition: all 0.15s; }
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: var(--primary); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card-title { font-size: 14px; font-weight: 600; color: #111827; margin-bottom: 6px; }
.kanban-card-meta { font-size: 11px; color: #9ca3af; }
.kanban-card-amount { font-size: 14px; font-weight: 700; color: var(--primary); margin-top: 4px; }
.kanban-card-customer { font-size: 12px; color: #6b7280; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f3f4f6; }
.kanban-card-days { font-size: 11px; padding: 2px 6px; border-radius: 8px; font-weight: 500; }
.kanban-card-days.overdue { background: #fee2e2; color: #dc2626; }
.kanban-card-days.warning { background: #fff7ed; color: #ea580c; }
.kanban-card-days.normal { background: #d1fae5; color: #059669; }
.kanban-col-body.drag-over { background: #eff6ff; border-radius: 6px; }
.kanban-empty { text-align: center; padding: 30px 10px; color: #d1d5db; font-size: 13px; }

/* Utility text colors */
.text-danger { color: var(--error, #dc2626); }
.text-warning { color: var(--warning, #f59e0b); }

/* ========== AI 助手浮层 ========== */
.ai-chat-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 900;
}
.ai-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  z-index: 901;
  flex-direction: column;
  overflow: hidden;
}
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.ai-chat-header .btn-link { color: #fff; font-size: 13px; }
.ai-chat-expand { color: #fff; text-decoration: none; font-size: 14px; }
.ai-chat-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px 4px;
  border-bottom: 1px solid #f0f0f0;
}
.ai-chat-chips .btn {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 12px;
}
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-bot { justify-content: flex-start; }
.ai-msg-bubble {
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.ai-msg-user .ai-msg-bubble { background: var(--primary, #00B8A5); color: #fff; }
.ai-msg-bot .ai-msg-bubble { background: #f4f6f8; color: #333; }
.ai-msg-model { font-size: 10px; color: #999; margin-top: 4px; text-align: right; }
.ai-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #f0f0f0;
}
.ai-chat-input .form-input { flex: 1; }

@media (max-width: 900px) { .task-stat-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .task-stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .kanban-board { flex-direction: column; } .kanban-column { max-width: 100%; min-width: 100%; } }

/* ===== 设备时间线（可视化履历轴：detail 履历页签 / timeline 页共用） ===== */
.tl-toolbar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:10px;}
.tl-chips{display:flex;gap:6px;flex-wrap:wrap;}
.tl-chip{border:1px solid var(--gray-200,#e5e7eb);background:#fff;color:#666;font-size:12px;padding:3px 10px;border-radius:12px;cursor:pointer;}
.tl-chip.active{background:var(--primary,#00B8A5);color:#fff;border-color:var(--primary,#00B8A5);}
.tl-year{font-size:13px;font-weight:700;color:var(--gray-600,#6b7280);margin:14px 0 6px;display:flex;align-items:center;gap:8px;}
.tl-year::after{content:"";flex:1;height:1px;background:var(--gray-100,#eef0f3);}
.tl-axis{padding-left:4px;}
.tl-node{display:flex;gap:10px;position:relative;padding-bottom:2px;}
.tl-node::before{content:"";position:absolute;left:5px;top:14px;bottom:-2px;width:2px;background:var(--gray-100,#eef0f3);}
.tl-node:last-child::before{display:none;}
.tl-dot{width:12px;height:12px;border-radius:50%;flex-shrink:0;margin-top:5px;position:relative;z-index:1;box-shadow:0 0 0 2px #fff;}
.tl-card{flex:1;padding:4px 0 10px;min-width:0;}
.tl-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:13px;}
.tl-date{color:#888;font-size:12px;white-space:nowrap;}
.tl-kind{font-size:11px;padding:0 7px;border-radius:8px;white-space:nowrap;}
.tl-title{font-weight:600;color:var(--gray-800,#1f2937);}
.tl-sub{font-size:11px;}
.tl-content{font-size:12px;color:#555;line-height:1.7;margin:3px 0 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word;}
.tl-content.open{-webkit-line-clamp:unset;cursor:pointer;}
.tl-content.more{cursor:pointer;color:#1e6fd9;}

/* 企微组织架构选人（派工 / 电气协同） */
.org-picker { color: #344054; }
.org-picker-summary { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; padding:2px 2px 14px; border-bottom:1px solid #eef1f4; }
.org-picker-summary b { display:block; font-size:17px; color:#101828; letter-spacing:.2px; }
.org-picker-summary span { display:block; margin-top:3px; font-size:12px; color:#98a2b3; }
.org-picker-summary em { font-style:normal; font-size:12px; color:#0e9384; background:#ecfdf8; border:1px solid #c6f0e8; padding:5px 9px; border-radius:20px; white-space:nowrap; }
.org-picker-layout { display:grid; grid-template-columns:224px minmax(0,1fr); gap:0; margin-top:14px; border:1px solid #e8edf1; border-radius:12px; overflow:hidden; background:#fff; }
.org-picker-side { background:#f8fbfb; border-right:1px solid #e8edf1; padding:12px 10px; max-height:52vh; overflow:auto; }
.org-picker-side-title { font-size:12px; font-weight:700; color:#667085; letter-spacing:.6px; padding:4px 8px 9px; }
.org-picker-tree { display:flex; flex-direction:column; gap:2px; }
.org-tree-row { display:flex; align-items:center; gap:7px; width:100%; border:0; background:transparent; color:#475467; border-radius:8px; padding:8px 10px; font-size:13px; text-align:left; cursor:pointer; line-height:1.3; }
.org-tree-row:hover { background:#eef8f6; color:#0e9384; }
.org-tree-row.active { background:#dff7f1; color:#0b7a6d; font-weight:700; }
.org-tree-folder { width:13px; height:11px; border-radius:3px; background:#b8d8d3; flex:0 0 auto; position:relative; }
.org-tree-row.active .org-tree-folder { background:#0e9384; }
.org-tree-folder:after { content:''; position:absolute; left:2px; top:-3px; width:6px; height:3px; border-radius:2px 2px 0 0; background:inherit; }
.org-tree-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.org-tree-count { font-size:11px; color:#98a2b3; background:#fff; border:1px solid #e4e7ec; border-radius:10px; padding:1px 6px; }
.org-tree-row.active .org-tree-count { color:#0e9384; border-color:#a7e3d7; }
.org-picker-main { min-width:0; padding:14px; }
.org-picker-toolbar { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.org-picker-search { position:relative; flex:1; min-width:0; }
.org-picker-search input { width:100%; height:38px; border:1px solid #e4e7ec; border-radius:9px; background:#fbfcfd; padding:0 12px 0 34px; outline:none; font-size:13px; color:#344054; box-sizing:border-box; }
.org-picker-search input:focus { border-color:#0e9384; background:#fff; box-shadow:0 0 0 3px rgba(14,147,132,.10); }
.org-picker-search span { position:absolute; left:12px; top:12px; width:13px; height:13px; border:2px solid #98a2b3; border-radius:50%; box-sizing:border-box; }
.org-picker-search span:after { content:''; position:absolute; width:6px; height:2px; background:#98a2b3; transform:rotate(45deg); right:-4px; bottom:-1px; border-radius:2px; }
.org-picker-count { font-size:12px; color:#667085; white-space:nowrap; }
.org-picker-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-height:44vh; overflow:auto; padding-right:2px; }
.org-person { position:relative; display:flex; align-items:center; gap:9px; min-width:0; padding:10px; border:1px solid #e8edf1; border-radius:11px; background:#fff; text-align:left; cursor:pointer; transition:border-color .15s,box-shadow .15s,background .15s; }
.org-person:hover { border-color:#a7e3d7; background:#f8fffd; }
.org-person.selected { border-color:#0e9384; background:#f0fdfa; box-shadow:0 0 0 2px rgba(14,147,132,.10); }
.org-avatar { flex:0 0 auto; width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#dff7f1,#b9ece2); color:#0b7a6d; font-weight:700; font-size:14px; }
.org-person-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.org-person-main b { font-size:13px; color:#344054; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.org-person-main small { font-size:11px; color:#98a2b3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.org-person-title { max-width:90px; font-size:11px; color:#667085; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.org-person-check { flex:0 0 auto; width:16px; height:16px; border:1.5px solid #d0d5dd; border-radius:50%; box-sizing:border-box; }
.org-person.selected .org-person-check { border-color:#0e9384; background:#0e9384; box-shadow:inset 0 0 0 3px #fff; }
.org-picker-empty { grid-column:1/-1; padding:38px 12px; text-align:center; color:#98a2b3; font-size:13px; }
.org-picker-selected { display:flex; align-items:center; gap:9px; margin-top:12px; padding:10px 12px; border:1px dashed #d7e3e0; border-radius:10px; background:#fbfefd; min-height:21px; font-size:13px; }
.org-picker-selected > span { color:#98a2b3; }
.org-selected-label { font-size:11px; color:#0e9384; background:#e6fffa; border-radius:6px; padding:2px 7px; }
.org-picker-selected b { color:#101828; }
.org-picker-selected small { color:#98a2b3; margin-left:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width: 720px) {
  .org-picker-layout { grid-template-columns:1fr; }
  .org-picker-side { max-height:170px; border-right:0; border-bottom:1px solid #e8edf1; }
  .org-picker-grid { grid-template-columns:1fr; max-height:38vh; }
  .org-picker-summary em { display:none; }
}
