/* ===========================================================
   理赔追踪器 · OA 商务风 UI（v2.0.0）
   浅色专业配色：白底 / 浅灰面板 / 商务蓝主色 #1677ff
   状态色：绿(成功) / 琥珀(警告) / 红(危险)
   =========================================================== */

:root {
  --bg-0:        #f5f7fa;
  --bg-1:        #eef1f5;
  --bg-2:        #f7f9fc;
  --bg-card:     #ffffff;
  --bg-card-hi: #f7f9fc;

  --line:        #e3e8ef;
  --line-hi:     #c9d3e0;

  --cyan:        #1677ff;     /* 主色：商务蓝（沿用变量名） */
  --cyan-soft:   #3e8bff;
  --mint:        #16a34a;     /* 已结案 / 成功 */
  --gold:        #d97706;     /* 即将到期 / 警告 */
  --rose:        #dc2626;     /* 撤案 / 危险 */
  --violet:      #7c3aed;     /* 大案 */
  --teal:        #0e7490;     /* 中案 */
  --blue:        #2563eb;     /* 小案 */
  --orange:      #ea580c;     /* 特例 */

  --txt-1:       #1f2329;
  --txt-2:       #4e5969;
  --txt-3:       #86909c;
  --txt-mute:    #b0b7c0;

  --radius:      6px;
  --shadow:      0 1px 4px rgba(31, 35, 41, 0.08);
  --shadow-hi:   0 4px 16px rgba(31, 35, 41, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--txt-1);
  font-size: 13px;
  letter-spacing: 0.02em;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input  { font-family: inherit; }

/* ====================== 日期输入 ====================== */
input[type="date"],
input[type="datetime-local"] {
  color-scheme: light;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ====================== 首次加载提示卡片（不遮挡下方内容） ====================== */
.loading-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.loading-overlay.fade-out {
  opacity: 0;
}
.loading-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 44px;
  box-shadow: 0 8px 32px rgba(31,35,41,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin {
  to { transform: rotate(360deg); }
}
.loading-text {
  font-size: 14px;
  color: var(--txt-2);
  letter-spacing: 0.06em;
}

/* ====================== 顶部栏 ====================== */
.hud-top {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 22px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}

.hud-brand {
  display: flex; align-items: center; gap: 14px;
}

.hud-logo {
  width: 42px; height: 42px;
  border: 2px solid var(--cyan);
  border-radius: 8px;
  position: relative;
  background: linear-gradient(135deg, rgba(22,119,255,0.12), rgba(22,119,255,0.02));
}
.hud-logo::before {
  content: ''; position: absolute;
  inset: 6px;
  border: 1px solid rgba(22,119,255,0.35);
  border-radius: 4px;
  transform: rotate(45deg);
}
.hud-logo::after {
  content: 'Σ'; position: absolute;
  inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--cyan); font-weight: 700; font-size: 18px;
}

.hud-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--txt-1);
}
.hud-sub {
  font-size: 11px;
  color: var(--txt-3);
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.hud-stats {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-card {
  min-width: 90px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--cyan);
  opacity: 0.55;
}
.stat-card.alert  { border-color: rgba(220,38,38,0.35); }
.stat-card.alert  .stat-num { color: var(--rose); }
.stat-card.warn   { border-color: rgba(217,119,6,0.35); }
.stat-card.warn   .stat-num { color: var(--gold); }
.stat-card.danger { border-color: rgba(220,38,38,0.45); }
.stat-card.danger .stat-num { color: var(--rose); }
/* v2.3.0 今日复查视图：今日更新（商务蓝）/ 今日新增（成功绿） */
.stat-card.todayupd { border-color: rgba(22,119,255,0.35); }
.stat-card.todayupd .stat-num { color: var(--cyan); }
.stat-card.todaynew { border-color: rgba(22,163,74,0.35); }
.stat-card.todaynew .stat-num { color: var(--mint); }
.stat-card:hover  { transform: translateY(-2px); box-shadow: var(--shadow-hi); }

/* 统计卡片可点击（跳转筛选视图） */
.stat-card[data-filter] {
  cursor: pointer;
  user-select: none;
}
.stat-card[data-filter]:hover {
  border-color: var(--cyan);
}
.stat-card[data-filter]:active {
  transform: translateY(0);
}
.stat-card.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), var(--shadow-hi);
  background: linear-gradient(180deg, rgba(22,119,255,0.06), var(--bg-card));
}

/* ---------- 追踪历史时间线 ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 4px;
  max-height: 260px;
  overflow-y: auto;
}
.tl-item {
  display: flex;
  gap: 10px;
  position: relative;
  padding-bottom: 14px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--line-hi);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 11px;
  height: 11px;
  min-width: 11px;
  border-radius: 50%;
  margin-top: 3px;
  background: var(--bg-card);
  border: 2px solid var(--cyan);
}
.tl-body { flex: 1; min-width: 0; }
.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.tl-action {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tl-ts {
  color: var(--txt-3);
  font-size: 10px;
  font-family: 'Consolas', 'Cascadia Code', monospace;
}
.tl-note {
  color: var(--txt-2);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 3px;
  white-space: pre-wrap;
  word-break: break-all;
}
.tl-next {
  margin-top: 3px;
  color: var(--gold);
  font-size: 11px;
}

/* 公估多条记录分隔 */
.assess-sep {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin: 8px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(217,119,6,0.35);
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
  font-family: 'Segoe UI', system-ui;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px;
  color: var(--txt-3);
  margin-top: 2px;
  letter-spacing: 0.08em;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 免登对接：顶栏当前用户区 */
.hud-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hud-user .user-name {
  font-size: 12px;
  color: var(--txt-2);
  letter-spacing: 0.04em;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-user .btn {
  padding: 3px 10px;
  font-size: 11px;
}

.data-dir {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  max-width: 320px;
}
.data-dir .lbl { color: var(--txt-3); }
.data-dir .dir {
  color: var(--txt-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* ====================== 按钮 ====================== */
.btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  letter-spacing: 0.06em;
  background: var(--bg-card);
  color: var(--txt-1);
  border: 1px solid var(--line-hi);
  transition: all 0.18s;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--shadow); }
.btn-primary {
  background: var(--cyan);
  color: #ffffff;
  border-color: var(--cyan);
}
.btn-primary:hover { background: #3e8bff; color: #ffffff; }
.btn-ghost { background: transparent; }
.btn-danger {
  color: var(--rose);
  border-color: rgba(220,38,38,0.4);
}
.btn-danger:hover { border-color: var(--rose); }
.btn-success {
  color: var(--mint);
  border-color: rgba(22,163,74,0.4);
}
.btn-success:hover { border-color: var(--mint); color: var(--mint); }
.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ====================== 筛选条 ====================== */
.filter-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--txt-2);
  font-size: 12px;
  transition: all 0.15s;
}
.chip:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
.chip.active {
  background: rgba(22,119,255,0.1);
  color: var(--cyan);
  border-color: var(--cyan);
}
.chip-alert.active    { background: rgba(220,38,38,0.08); color: var(--rose); border-color: var(--rose); }
.chip-warn.active     { background: rgba(217,119,6,0.08); color: var(--gold); border-color: var(--gold); }
.chip-danger.active   { background: rgba(220,38,38,0.08); color: var(--rose); border-color: var(--rose); }
.chip-violet.active   { background: rgba(124,58,237,0.08); color: var(--violet); border-color: var(--violet); }
.chip-teal.active     { background: rgba(14,116,144,0.08); color: var(--teal); border-color: var(--teal); }
.chip-blue.active     { background: rgba(37,99,235,0.08); color: var(--blue); border-color: var(--blue); }
.chip-orange.active   { background: rgba(234,88,12,0.08); color: var(--orange); border-color: var(--orange); }
.chip-cyan.active     { background: rgba(22,119,255,0.08); color: var(--cyan); border-color: var(--cyan); }
.chip-gold.active     { background: rgba(217,119,6,0.08); color: var(--gold); border-color: var(--gold); }
/* v2.3.0 今日复查视图标签 */
.chip-mint.active     { background: rgba(22,163,74,0.08); color: var(--mint); border-color: var(--mint); }

.filter-search input {
  width: 240px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.filter-search input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}

/* ====================== 主体 ====================== */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px 22px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.panel::before {
  content: none;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card-hi);
  border-bottom: 1px solid var(--line);
}
.panel-head .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}
.panel-title {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--txt-1);
  font-weight: 600;
}
.panel-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--txt-3);
}
.panel-head .btn-ghost { margin-left: auto; }

/* ====================== 表格 ====================== */
.table-wrap {
  flex: 1;
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 1700px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card-hi);
  color: var(--txt-2);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line-hi);
  z-index: 1;
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
  cursor: pointer;
}
.data-table tbody tr:hover {
  background: rgba(22,119,255,0.05);
}
.data-table tbody tr.selected {
  background: rgba(22,119,255,0.09);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.data-table tbody td {
  padding: 9px 8px;
  color: var(--txt-1);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.placeholder {
  text-align: center !important;
  padding: 40px 20px !important;
  color: var(--txt-3) !important;
  font-style: italic;
}

/* ====================== 冻结列（sticky） ====================== */
/* 基础 sticky + 背景（防止内容穿透） */
th.sticky-left,
th.sticky-right,
td.sticky-left,
td.sticky-right {
  position: sticky;
  z-index: 2;
  left: 0;  /* 后备值：JS 会精确计算并覆盖 */
}
th.sticky-left  { background: var(--bg-card-hi); }
th.sticky-right { background: var(--bg-card-hi); left: auto; }
td.sticky-left  { background: var(--bg-card); }
td.sticky-right { background: var(--bg-card); left: auto; }

/* 冻结列最小宽度（保证列宽稳定，JS 计算可靠） */
th[data-col-key="__seq"], td[data-col-key="__seq"] { min-width: 44px; text-align: center; }
th[data-col-key="保险公司"], td[data-col-key="保险公司"] { min-width: 72px; }
th[data-col-key="__no"], td[data-col-key="__no"] { min-width: 190px; }
th[data-col-key="__op"], td[data-col-key="__op"] { min-width: 56px; text-align: center; }

/* 表头 corner cells：top:0 垂直滚动时固定在顶部，最高层级 */
th.sticky-left  { z-index: 4; top: 0; }
th.sticky-right { z-index: 4; top: 0; }

/* 选中行 / 悬浮行的冻结列背景覆盖 */
tr:hover td.sticky-left,
tr:hover td.sticky-right { background: rgba(22,119,255,0.05); }
tr.selected td.sticky-left,
tr.selected td.sticky-right { background: rgba(22,119,255,0.09); }

/* 左冻结组右边缘阴影 */
th.sticky-left-last::after,
td.sticky-left-last::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: -6px;
  width: 6px;
  background: linear-gradient(to right, rgba(0,0,0,0.08), transparent);
  pointer-events: none;
}
/* 右冻结列左边缘阴影 */
th.sticky-right::before,
td.sticky-right::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -6px;
  width: 6px;
  background: linear-gradient(to left, rgba(0,0,0,0.08), transparent);
  pointer-events: none;
}

/* ====================== 分页控件 ====================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-card);
  flex-shrink: 0;
}
.pagination:empty {
  display: none;
}
.pg-info {
  font-size: 12px;
  color: var(--txt-3);
  white-space: nowrap;
}
.pg-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--txt-2);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.pg-btn:hover:not(.disabled):not(.active) {
  background: var(--bg-card-hi);
  border-color: var(--cyan);
  color: var(--cyan);
}
.pg-btn.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
  font-weight: 600;
}
.pg-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 28px;
  color: var(--txt-3);
  font-size: 12px;
  user-select: none;
}
.pg-size {
  margin-left: 8px;
  padding: 3px 6px;
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--txt-2);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}
.pg-size:focus {
  border-color: var(--cyan);
}

/* ====================== 追加导入预览 ====================== */
.import-summary {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-1);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.imp-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  color: var(--txt-2);
}
.imp-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--txt-1);
}
.imp-stat-new .imp-num { color: var(--mint); }
.imp-stat-dup .imp-num { color: var(--txt-3); }
.imp-file {
  font-size: 11px;
  color: var(--txt-3);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-preview-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-height: 340px;
}
.import-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.import-section h4 {
  font-size: 11px;
  color: var(--txt-3);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.import-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  max-height: 280px;
}
.import-dup {
  opacity: 0.6;
}
.imp-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.imp-row:last-child { border-bottom: none; }
.imp-row-dup { color: var(--txt-3); }
.imp-no {
  color: var(--cyan);
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
}
.imp-name {
  color: var(--txt-1);
  min-width: 48px;
  flex-shrink: 0;
}
.imp-unit {
  color: var(--txt-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.imp-empty {
  text-align: center;
  color: var(--txt-3);
  padding: 20px;
  font-size: 12px;
}
.imp-more {
  text-align: center;
  color: var(--txt-3);
  padding: 6px;
  font-size: 11px;
}

/* ====================== 案件状态徽章 ====================== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid currentColor;
  background: rgba(255,255,255,0.6);
}
.badge-rule { color: var(--cyan); }
.badge-rule-big { color: var(--violet); background: rgba(124,58,237,0.07); }
.badge-rule-medium { color: var(--teal); background: rgba(14,116,144,0.07); }
.badge-rule-small { color: var(--blue); background: rgba(37,99,235,0.07); }
.badge-rule-special { color: var(--orange); background: rgba(234,88,12,0.07); }
.badge-rule-death { color: var(--rose); background: rgba(220,38,38,0.07); }
.badge-rule-unmatched { color: var(--txt-3); background: var(--bg-1); }

.badge-days-overdue { color: var(--rose); }
.badge-days-today   { color: var(--gold); }
.badge-days-future  { color: var(--txt-2); }

.badge-status-closed { color: var(--mint); }
.badge-status-withdrawn { color: var(--txt-3); }
.badge-status-processing { color: var(--cyan); }

.badge-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  background: var(--bg-1);
  color: var(--txt-2);
  border: 1px solid var(--line);
  margin-right: 3px;
}

/* ====================== 详情抽屉（浮动覆盖） ====================== */
.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: -4px 0 24px rgba(0,0,0,0.35);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 92vw;
  z-index: 10;
  transform: translateX(105%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.22s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius) 0 0 var(--radius);
}
.detail-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.detail-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.alert-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(217,119,6,0.07);
  border: 1px solid rgba(217,119,6,0.35);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: 12px;
}
.alert-banner a {
  color: var(--cyan);
  text-decoration: underline;
  margin-left: 8px;
}
.alert-banner .alert-icon {
  font-size: 16px;
  color: var(--gold);
}

.detail-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.detail-section:last-child {
  border-bottom: none;
}
.detail-section h4 {
  font-size: 11px;
  color: var(--txt-3);
  letter-spacing: 0.14em;
  margin-bottom: 10px;
  text-transform: uppercase;
  border-left: 3px solid var(--cyan);
  padding-left: 6px;
}

.kv-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  font-size: 12px;
}
.kv-grid dt {
  color: var(--txt-3);
  white-space: nowrap;
}
.kv-grid dd {
  color: var(--txt-1);
  word-break: break-all;
}
.kv-grid dd.highlight { color: var(--cyan); }
.kv-grid dd.danger    { color: var(--rose); }
.kv-grid dd.mint      { color: var(--mint); }
.kv-grid dd.gold      { color: var(--gold); }

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.form-row label {
  font-size: 11px;
  color: var(--txt-3);
  letter-spacing: 0.06em;
}
.form-row input,
.form-row select,
.form-row textarea {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}
.form-row textarea {
  min-height: 60px;
  resize: vertical;
}

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

/* ====================== Modal ====================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(31,35,41,0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.show {
  display: flex;
  animation: modal-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  width: 560px;
  max-width: 92vw;
  box-shadow: var(--shadow-hi);
}
.modal-card h3 {
  color: var(--txt-1);
  font-size: 15px;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}
.modal-card .hint {
  color: var(--txt-3);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.dir-input {
  display: flex;
  gap: 8px;
}
.dir-input input {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
}
.file-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.file-row label {
  color: var(--txt-2);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.file-row input {
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: 'Consolas', 'Cascadia Code', monospace;
}
.file-row input:focus { border-color: var(--cyan); }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

/* ====================== 字段筛选行 ====================== */
.field-filter-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 8px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.field-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
  flex: 1;
  max-width: 260px;
}
.field-filter-item label {
  color: var(--txt-3);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.field-filter-item input {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: 'Consolas', 'Cascadia Code', monospace;
  transition: border-color 0.15s;
}
.field-filter-item input:focus { border-color: var(--cyan); }
.field-filter-item input::placeholder { color: var(--txt-mute); }

/* ====================== Toast ====================== */
.toast-container {
  position: fixed;
  top: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 240px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  box-shadow: var(--shadow-hi);
  animation: toast-in 0.25s ease;
}
.toast.success { border-left-color: var(--mint); }
.toast.warn    { border-left-color: var(--gold); }
.toast.error   { border-left-color: var(--rose); }
.toast .t-title {
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--txt-1);
}
.toast.success .t-title { color: var(--mint); }
.toast.warn    .t-title { color: var(--gold); }
.toast.error   .t-title { color: var(--rose); }
.toast .t-msg {
  color: var(--txt-2);
  font-size: 11px;
}
@keyframes toast-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ====================== 操作反馈（按钮态变化） ====================== */
@keyframes btn-flash {
  0%   { box-shadow: 0 0 0 0 rgba(22,119,255,0.35); }
  100% { box-shadow: 0 0 0 12px rgba(22,119,255,0); }
}
.btn.flash {
  animation: btn-flash 0.5s ease;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #c4cdd9;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a8b4c4;
}

/* ====================== 响应式 ====================== */
@media (max-width: 1100px) {
  .detail-panel { width: 100%; max-width: 100vw; border-radius: 0; }
}

/* ====================== 表格单元格文本截断 ====================== */
.cell-text {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ====================== 公估标记（列表可点击切换） ====================== */
.badge-tag.assess-on {
  color: var(--gold);
  border-color: rgba(217,119,6,0.4);
  cursor: pointer;
  transition: all 0.15s;
}
.badge-tag.assess-on:hover {
  background: rgba(217,119,6,0.08);
}
.badge-tag.assess-off {
  color: var(--txt-3);
  cursor: pointer;
  transition: all 0.15s;
}
.badge-tag.assess-off:hover {
  color: var(--gold);
  border-color: rgba(217,119,6,0.4);
}

/* ---------- 手动指定类型小标 ---------- */
.tag-manual {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  border-radius: 3px;
  color: var(--gold);
  border: 1px dashed rgba(217,119,6,0.5);
}

/* ---------- 追踪内容（多条动态） ---------- */
.track-entry {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.track-entry .track-input {
  flex: 1;
  min-height: 54px;
  resize: vertical;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
}
.track-entry .track-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}
.track-entry .track-del {
  color: var(--rose);
  border-color: rgba(220,38,38,0.35);
  min-width: 28px;
}

/* ---------- 宽 Modal（列设置 / 规则设置） ---------- */
.modal-card.modal-wide {
  width: 860px;
  max-height: 86vh;
  overflow-y: auto;
}

/* ---------- 列设置复选网格 ---------- */
.cols-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 12px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.col-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--txt-2);
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-check:hover { color: var(--cyan); background: rgba(22,119,255,0.06); }
.col-check input { accent-color: var(--cyan); }
.col-check.col-fixed { color: var(--txt-mute); cursor: default; }

/* ---------- 规则设置表格 ---------- */
.rules-table-wrap {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rules-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card-hi);
  color: var(--txt-2);
  font-weight: 600;
  text-align: left;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line-hi);
  white-space: nowrap;
}
.rules-table tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.rules-table input,
.rules-table select {
  width: 100%;
  padding: 5px 8px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: 4px;
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
}
.rules-table input:focus,
.rules-table select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}

/* ---------- 公估编辑区 ---------- */
.assess-edit .form-row { margin-bottom: 8px; }

/* ---------- 序号（顺联） ---------- */
.seq-num {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  color: var(--txt-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- 保单号 / 报案号 合并列（一列两行 + 复制） ---------- */
.no-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0;
}
.no-line {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 300px;
}
.no-lbl {
  flex: none;
  font-size: 10px;
  color: var(--txt-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 3px;
  line-height: 14px;
}
.no-val {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-family: Consolas, 'Courier New', monospace;
  letter-spacing: 0.2px;
}

/* ---------- 快捷复制按钮 ---------- */
.copy-btn {
  flex: none;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--txt-3);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.copy-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
.copy-btn.copied {
  color: var(--mint);
  border-color: var(--mint);
}
.dd-copy {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- 理赔员内联编辑 ---------- */
.cell-edit.officer {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px dashed transparent;
  transition: all 0.15s;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-edit.officer:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.cell-edit.officer .edit-mark {
  font-size: 10px;
  color: var(--txt-3);
  flex: none;
}
.cell-edit.officer:hover .edit-mark { color: var(--cyan); }

/* 普通客服视角：「工伤客服」只读展示（无编辑标记、无手型） */
.officer-readonly {
  display: inline-block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--txt-2);
  cursor: default;
}

.officer-input {
  width: 110px;
  padding: 2px 6px;
  background: var(--bg-card);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}

/* ---------- 追踪记录（流程图节点式） ---------- */
.rec-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}
.rec-empty {
  padding: 14px 10px;
  text-align: center;
  color: var(--txt-mute);
  font-size: 12px;
  border: 1px dashed var(--line-hi);
  border-radius: var(--radius);
}
.rec-item {
  display: flex;
  gap: 8px;
  align-items: stretch;
  padding: 8px 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  margin-bottom: 10px;
}
/* 流程连线：节点下方 → 下一节点 */
.rec-item::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 38px;
  bottom: -13px;
  width: 2px;
  background: var(--line-hi);
}
.rec-item::after {
  content: '';
  position: absolute;
  left: 17px;
  bottom: -10px;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--line-hi);
}
.rec-item:last-child::before,
.rec-item:last-child::after { display: none; }
/* 流程节点圆 */
.rec-step {
  flex: none;
  width: 28px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  background: rgba(22,119,255,0.07);
}
/* 已完成节点（已填写追踪结果）→ 绿色对勾 */
.rec-step.done {
  border-color: var(--mint);
  color: #ffffff;
  background: var(--mint);
}
.rec-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 追踪记录操作人标记（多人模式显示谁填的） */
.rec-user {
  align-self: flex-start;
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--cyan);
  background: rgba(22,119,255,0.07);
  border: 1px solid rgba(22,119,255,0.3);
  border-radius: 3px;
  padding: 1px 7px;
}
/* 顶栏登录用户区 */
.user-chip { margin-right: 6px; }
.user-chip .dir { color: var(--cyan); letter-spacing: 1px; }
.rec-date {
  width: 150px;
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: 4px;
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
  color-scheme: light;
}
.rec-date:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}
.rec-note {
  width: 100%;
  min-height: 44px;
  resize: vertical;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
}
.rec-note:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}
.rec-del {
  flex: none;
  align-self: flex-start;
  color: var(--rose);
  border-color: rgba(220,38,38,0.35);
  min-width: 28px;
}
.rec-del:hover { border-color: var(--rose); }

/* ---------- 保单号 / 报案号 字体加大 ---------- */
.no-val {
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

/* ---------- 追踪记录更紧凑 ---------- */
.rec-list { gap: 0; margin-bottom: 6px; }
.rec-item { padding: 6px 6px 9px; gap: 6px; margin-bottom: 9px; }
.rec-item::before { left: 16px; top: 32px; bottom: -12px; }
.rec-item::after  { left: 12px; bottom: -9px; }
.rec-step { width: 22px; height: 22px; line-height: 20px; font-size: 11px; }
.rec-main { gap: 4px; }
.rec-date { width: 128px; padding: 3px 6px; font-size: 11.5px; }
.rec-note { min-height: 28px; padding: 5px 8px; font-size: 11.5px; }
.rec-del { min-width: 24px; }
.rec-empty { padding: 10px 8px; }

/* ---------- 列表单元格可编辑（任意表2 列） ---------- */
.cell-editable {
  display: inline-block;
  max-width: 100%;
  padding: 2px 4px;
  border: 1px dashed transparent;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  transition: all 0.15s;
}
.cell-editable:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.cell-editable::after {
  content: '✎';
  font-size: 9px;
  color: var(--txt-3);
  margin-left: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}
.cell-editable:hover::after { opacity: 0.9; }

/* ---------- 案件列表紧凑化 ---------- */
.data-table thead th {
  padding: 5px 6px;
  letter-spacing: 0.04em;
}
.data-table tbody td {
  padding: 3px 6px;
  line-height: 1.25;
}
.data-table tbody tr { border-bottom: 1px solid var(--line); }

/* 合并列（保单/报案两行）压缩行距 */
.no-cell { gap: 1px; padding: 0; }
.no-line { gap: 3px; line-height: 1.2; }
.no-val { line-height: 1.2; }
.copy-btn {
  width: 15px;
  height: 15px;
  line-height: 13px;
  font-size: 10px;
}

/* 可编辑单元格减负 */
.cell-editable { padding: 1px 3px; }

/* 徽章瘦身 */
.badge { padding: 1px 6px; font-size: 10.5px; }
.badge-tag { padding: 1px 5px; font-size: 10.5px; }

/* ---------- 列间距（水平）收紧 ---------- */
.data-table thead th { padding: 5px 4px; }
.data-table tbody td { padding: 3px 4px; }
.cell-editable { padding: 1px 2px; }
.cell-edit.officer { padding: 1px 2px; }
.badge { padding: 1px 5px; }
.badge-tag { padding: 1px 4px; margin-right: 2px; }
.seq-num { min-width: 20px; }
.no-line { gap: 2px; max-width: 280px; }
.no-lbl { font-size: 9px; padding: 0 2px; }
.copy-btn { width: 14px; height: 14px; line-height: 12px; font-size: 9.5px; margin-left: 1px; }

/* ---------- 列宽上限（长文本列截断） ---------- */
.cell-editable {
  max-width: 150px;
}
.cell-edit.officer {
  max-width: 120px;
  display: inline-flex;
  align-items: center;
}
.data-table thead th {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-panel {
  min-width: 0;
}
.data-table {
  width: max-content;
}

/* ---------- 新增案件 Modal ---------- */
.addcase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 10px;
  margin: 10px 0 4px;
}
.addcase-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.addcase-item label {
  font-size: 11px;
  color: var(--txt-2);
  letter-spacing: 0.03em;
}
.addcase-item label .req { color: var(--rose); margin-left: 2px; }
.addcase-item input,
.addcase-item select {
  padding: 5px 8px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
  color-scheme: light;
  min-width: 0;
}
.addcase-item input:focus,
.addcase-item select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}
.addcase-item.item-wide { grid-column: span 2; }
.custom-case-list {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  max-height: 140px;
  overflow: auto;
}
.custom-case-list .ccl-title {
  font-size: 11px;
  color: var(--txt-2);
  margin-bottom: 6px;
}
.ccl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  font-size: 11.5px;
  border-radius: 4px;
}
.ccl-row:hover { background: rgba(22,119,255,0.06); }
.ccl-no { font-family: Consolas, monospace; color: var(--txt-1); }
.ccl-name { color: var(--txt-2); }
.ccl-del {
  margin-left: auto;
  color: var(--rose);
  border-color: rgba(220,38,38,0.35);
  min-width: 24px;
  padding: 2px 6px;
  font-size: 11px;
}
.ccl-empty { color: var(--txt-3); font-size: 11.5px; font-style: italic; padding: 4px 6px; }

/* ---------- 内部状态快捷按钮（规则/类型区） ---------- */
.status-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 6px;
}
.st-quick.st-cur {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(22,119,255,0.07);
}
.status-custom {
  display: flex;
  gap: 8px;
  align-items: center;
}
.status-custom select {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
}

/* ---------- 下次追踪日期行 ---------- */
.next-date-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.next-date-row > label {
  font-size: 11.5px;
  color: var(--txt-3);
  white-space: nowrap;
}
.next-date-row input[type="date"] {
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
  color-scheme: light;
}
.next-date-row input[type="date"]:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}
.quick-defer {
  display: inline-flex;
  gap: 4px;
}
.date-clear {
  font-size: 10.5px;
  color: var(--txt-3);
}

/* ---------- 公估外派左右结构 ---------- */
.assess-lr {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 7px 10px;
  align-items: center;
}
.assess-lr label {
  font-size: 11.5px;
  color: var(--txt-3);
  white-space: nowrap;
  text-align: right;
  position: relative;
}
.assess-lr input[type="text"],
.assess-lr input[type="date"],
.assess-lr textarea {
  width: 100%;
  padding: 5px 8px;
  background: var(--bg-card);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  color: var(--txt-1);
  font-size: 12px;
  outline: none;
  font-family: inherit;
  color-scheme: light;
  min-width: 0;
}
.assess-lr input[type="date"] { color: var(--txt-1); }
.assess-lr input:focus,
.assess-lr textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}
.assess-lr textarea {
  resize: vertical;
  min-height: 34px;
  line-height: 1.4;
}
/* 渠道：自动读取只读样式 */
.assess-lr input[readonly] {
  color: var(--txt-2);
  background: var(--bg-1);
  border-style: dashed;
  cursor: default;
}
.assess-auto-tag {
  display: inline-block;
  margin-left: 3px;
  padding: 0 3px;
  font-size: 9px;
  color: var(--cyan);
  border: 1px solid rgba(22,119,255,0.3);
  border-radius: 3px;
  vertical-align: 1px;
}
.assess-edit.assess-lr {
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-2);
}

/* 追踪日到期：自动生成的待填写记录高亮 */
.rec-item.rec-pending {
  border: 1px solid rgba(217,119,6,0.5);
  background: rgba(217,119,6,0.05);
  border-radius: var(--radius);
}
.rec-item.rec-pending .rec-step {
  background: rgba(217,119,6,0.12);
  border-color: rgba(217,119,6,0.6);
  color: var(--gold);
}
.rec-item.rec-pending .rec-note {
  border-color: rgba(217,119,6,0.4);
}
/* 到期提示条 */
.rec-due-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--gold);
  background: rgba(217,119,6,0.06);
  border: 1px solid rgba(217,119,6,0.35);
  border-radius: var(--radius);
}
.rec-due-banner .alert-icon { font-size: 13px; }

/* ===========================================================
   v2.0.0 新增：追踪流程图 + 图片材料（证据）
   =========================================================== */

/* ---------- 流程图：起止节点（胶囊） ---------- */
.flow-node {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px 2px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 11.5px;
  background: var(--bg-1);
  border: 1px solid var(--line-hi);
  color: var(--txt-2);
  width: max-content;
  max-width: 100%;
}
.flow-node .fn-icon {
  font-size: 12px;
  line-height: 1;
}
.flow-node .fn-label { font-weight: 600; }
.flow-node .fn-date {
  font-family: Consolas, 'Courier New', monospace;
  color: var(--txt-3);
}
.flow-node.flow-start {
  border-color: rgba(22,119,255,0.35);
  background: rgba(22,119,255,0.05);
  color: var(--cyan);
}
.flow-node.flow-start .fn-date { color: var(--cyan); }
.flow-node.flow-end {
  border-color: rgba(217,119,6,0.4);
  background: rgba(217,119,6,0.06);
  color: var(--gold);
}
.flow-node.flow-end .fn-date { color: var(--gold); }
/* 起止节点与首/末记录节点之间的连线 */
.flow-node.flow-start::after,
.flow-node.flow-end::before {
  content: '';
  display: none;
}

/* ---------- 图片材料（证据） ---------- */
.rec-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}
.img-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  border: 1px solid var(--line-hi);
  background: var(--bg-1);
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.img-thumb:hover {
  border-color: var(--cyan);
  box-shadow: var(--shadow);
}
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-thumb .img-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1px 4px;
  font-size: 9px;
  color: #ffffff;
  background: rgba(31,35,41,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.img-del {
  position: absolute;
  top: 1px; right: 1px;
  width: 16px;
  height: 16px;
  line-height: 14px;
  text-align: center;
  font-size: 10px;
  color: #ffffff;
  background: rgba(220,38,38,0.85);
  border-radius: 3px;
  cursor: pointer;
  border: none;
  padding: 0;
}
.img-del:hover { background: var(--rose); }
.btn-img-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--txt-2);
  background: var(--bg-2);
  border: 1px dashed var(--line-hi);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-img-add:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}
.btn-img-add.uploading { opacity: 0.5; cursor: wait; }
.rec-imgs input[type="file"] { display: none; }
.rec-imgs-count {
  font-size: 10.5px;
  color: var(--txt-3);
}

/* ---------- 图片放大预览（Lightbox） ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(31,35,41,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.lightbox .lb-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 12px;
  background: rgba(31,35,41,0.6);
  padding: 4px 14px;
  border-radius: 99px;
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox .lb-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
  font-size: 18px;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  cursor: pointer;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,0.15); }

/* ---------- 导入窗口提示（浅色下深色文字） ---------- */
.modal-card .hint b { color: var(--txt-1); }

/* ===========================================================
   v2.1.0 新增：查看进度弹窗 + 添加追踪进度弹窗
   =========================================================== */

/* ---------- 通用弹窗尺寸 ---------- */
.modal-card.modal-progress {
  width: 680px;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.modal-card.modal-add-rec {
  width: 560px;
  max-width: 92vw;
}

/* ---------- 查看进度弹窗头部 ---------- */
.modal-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.modal-progress-head h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--txt-1);
  margin: 0;
}
.modal-progress-head h3 span { font-weight: 400; color: var(--txt-3); }

/* ---------- 查看进度弹窗内容区 ---------- */
.modal-progress-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px 26px;
}

/* ---------- 干净的时间轴流程图 ---------- */
.progress-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 24px;
}
.progress-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line-hi);
}

/* 通用节点 */
.progress-node {
  position: relative;
  padding: 0 0 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.progress-node:last-child { padding-bottom: 0; }

/* 节点圆点 */
.progress-node .pn-dot {
  position: absolute;
  left: -21px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--line-hi);
  z-index: 1;
}
/* 当前/高亮节点（参考图片：橙色大点） */
.progress-node.current .pn-dot {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(217,119,6,0.12);
}
/* 已完成节点（绿色） */
.progress-node.done .pn-dot {
  border-color: var(--mint);
  background: var(--mint);
}
/* 起点节点 */
.progress-node.start .pn-dot {
  border-color: var(--cyan);
  background: var(--cyan);
}
/* v2.1.1 外派公估节点（紫色） */
.progress-node.assess .pn-dot {
  border-color: #722ed1;
  background: #722ed1;
}
.progress-node.assess .pn-title {
  color: #722ed1;
}

/* 节点标题 */
.progress-node .pn-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-1);
  line-height: 1.5;
}
.progress-node.current .pn-title {
  color: var(--gold);
}
.progress-node.done .pn-title {
  color: var(--txt-1);
}

/* 节点日期 */
.progress-node .pn-date {
  font-size: 11px;
  color: var(--txt-3);
  font-family: Consolas, 'Courier New', monospace;
}

/* 节点备注 */
.progress-node .pn-note {
  font-size: 12px;
  color: var(--txt-2);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--bg-2);
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-top: 2px;
}

/* 节点内图片缩略图 */
.progress-node .pn-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.progress-node .pn-imgs .img-thumb {
  width: 72px;
  height: 72px;
  border-radius: 6px;
}

/* 节点操作（编辑按钮） */
.progress-node .pn-actions {
  margin-top: 2px;
}
.progress-node .pn-actions button {
  font-size: 11px;
  padding: 3px 10px;
}

/* ---------- 全部图片平铺区 ---------- */
.progress-all-imgs {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-hi);
}
.progress-all-imgs h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-1);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.progress-all-imgs h4 .count {
  font-size: 11px;
  font-weight: 400;
  color: var(--txt-3);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 99px;
}
.progress-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.progress-img-grid .img-thumb {
  width: 100%;
  height: 96px;
  border-radius: 6px;
}

/* ---------- 添加追踪进度弹窗 ---------- */
.add-rec-imgs {
  border: 1px dashed var(--line-hi);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--bg-2);
}
.add-rec-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.add-rec-img-grid .img-thumb {
  width: 100%;
  height: 72px;
  border-radius: 4px;
}
.add-rec-img-grid:empty { margin-bottom: 0; }
.add-rec-imgs input[type="file"] { display: none; }

/* ---------- 详情面板追踪流程快捷入口 ---------- */
.track-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.track-actions .btn { padding: 6px 14px; }
.track-next-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
}
.track-next-info .lbl { color: var(--txt-3); }
.track-next-info .val { font-weight: 600; color: var(--txt-1); }
.track-next-info .days { font-size: 11px; }

/* ====================== 批量选择（复选框列） ====================== */
.col-check {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  text-align: center;
  padding: 0 4px !important;
}
.row-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--cyan);
  vertical-align: middle;
}
/* 批量操作栏 */
.batch-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--cyan);
  border-radius: var(--radius);
  margin: 0 0 8px 0;
  box-shadow: 0 2px 8px rgba(22,119,255,0.12);
  font-size: 13px;
}
.batch-bar.show { display: flex; }
.batch-bar .batch-info {
  color: var(--txt-2);
  flex: 1;
}
.batch-bar .batch-info strong {
  color: var(--cyan);
  font-size: 15px;
}
