* { box-sizing: border-box; }

/* 加相机结果网格 */
.ac-grid { display:grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
.ac-item { background:#fff; border:1px solid #ecf0f5; border-radius:8px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.ac-item img { width:100%; height:160px; object-fit:cover; border-radius:6px; background:#f4f6fa; }
.ac-item .ac-name { font-size:12px; color:#667; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ac-drop { min-height:116px; border:2px dashed #cfd7e6; border-radius:8px; background:#fff; display:flex; align-items:center; justify-content:center; gap:14px; color:#556070; margin:0 0 10px; padding:18px; text-align:left; transition:border-color .15s, background .15s, color .15s; }
.ac-drop i { font-size:34px; color:#3d5fff; }
.ac-drop b { display:block; color:#273142; font-size:15px; margin-bottom:4px; }
.ac-drop span { display:block; font-size:13px; color:#7a8494; }
.ac-drop.dragging { border-color:#3d5fff; background:#f3f6ff; color:#273142; }
.ac-file-summary { margin:0 2px 12px; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }

/* 交付流程 */
.delivery-cell { display:flex; flex-direction:column; gap:3px; min-width:88px; }
.delivery-cell span { font-size:12px; color:#777; white-space:nowrap; }
.delivery-flow { display:flex; flex-direction:column; gap:14px; }
.delivery-flow-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.delivery-flow-title { font-weight:600; color:#1f2937; }
.delivery-flow-sub { color:#6b7280; font-size:13px; margin-top:3px; }
.delivery-batches { display:flex; flex-wrap:wrap; gap:8px; }
.delivery-batch-wrap { position:relative; }
.delivery-batch-tab { border:1px solid #d9dde6; background:#fff; border-radius:8px; padding:8px 10px; display:flex; flex-direction:column; gap:2px; min-width:110px; text-align:left; cursor:pointer; }
.delivery-batch-tab b { font-size:13px; color:#273142; }
.delivery-batch-tab span { font-size:12px; color:#6b7280; }
.delivery-batch-tab.active { border-color:#3d5fff; background:#f3f6ff; }
.delivery-batch-tab.rejected { border-color:#fecaca; background:#fff1f2; }
.delivery-batch-tab.rejected b { color:#991b1b; }
.delivery-batch-tab.rejected span { color:#b91c1c; }
.delivery-batch-delete { position:absolute; top:-7px; right:-7px; width:22px; height:22px; border:1px solid #fca5a5; border-radius:50%; background:#fff; color:#dc2626; line-height:18px; padding:0; font-size:16px; z-index:2; box-shadow:0 1px 3px rgba(0,0,0,.12); }
.delivery-batch-delete:hover { background:#fee2e2; }
.delivery-active { border:1px solid #ecf0f5; border-radius:8px; padding:12px; background:#fff; display:flex; flex-direction:column; gap:12px; }
.delivery-active-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.delivery-active-head b { display:block; color:#1f2937; }
.delivery-active-head span { font-size:12px; color:#6b7280; }
.delivery-active-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.delivery-reject-box { display:flex; flex-direction:column; gap:6px; }
.delivery-reject-box label { font-size:13px; color:#374151; font-weight:600; }
.delivery-reject-current { color:#991b1b; font-size:12px; font-weight:600; }
.delivery-drop { min-height:96px; border:2px dashed #cfd7e6; border-radius:8px; display:flex; align-items:center; justify-content:center; gap:12px; padding:16px; color:#556070; background:#fbfcff; transition:border-color .15s, background .15s; }
.delivery-drop i { font-size:30px; color:#3d5fff; }
.delivery-drop b { display:block; color:#273142; font-size:14px; }
.delivery-drop span { display:block; font-size:12px; color:#7a8494; margin-top:3px; }
.delivery-drop.dragging { border-color:#3d5fff; background:#eef3ff; }
.delivery-upload-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.delivery-queued { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:10px; padding:10px; border:1px dashed #cfd7e6; border-radius:8px; background:#fbfcff; }
.delivery-queued-img { position:relative; min-width:0; border:1px solid #ecf0f5; border-radius:8px; padding:6px; background:#fff; }
.delivery-queued-img button { position:absolute; top:2px; right:2px; width:22px; height:22px; border:none; border-radius:50%; background:rgba(220,38,38,.92); color:#fff; line-height:18px; padding:0; font-size:16px; }
.delivery-queued-img img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:6px; background:#f4f6fa; display:block; }
.delivery-queued-img span { display:block; margin-top:5px; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.delivery-images { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:10px; }
.delivery-img { border:1px solid #ecf0f5; border-radius:8px; padding:6px; background:#fff; color:#374151; text-decoration:none; min-width:0; }
.delivery-img a { color:#374151; text-decoration:none; }
.delivery-img img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:6px; background:#f4f6fa; display:block; }
.delivery-img span { display:block; margin-top:5px; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.delivery-img-wrap { position:relative; }
.delivery-image-delete { position:absolute; top:2px; right:2px; width:22px; height:22px; border:none; border-radius:50%; background:rgba(220,38,38,.92); color:#fff; line-height:18px; padding:0; font-size:16px; z-index:2; }
.delivery-download { position:absolute; top:2px; left:2px; width:24px; height:24px; border-radius:50%; background:rgba(61,95,255,.95); color:#fff !important; display:flex; align-items:center; justify-content:center; z-index:2; font-size:13px; }
.delivery-file-card { min-height:120px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:7px; }
.delivery-file-card i { font-size:32px; color:#3d5fff; }
.delivery-file-card b { display:block; max-width:100%; color:#273142; font-size:12px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.delivery-file-card span { margin-top:0; color:#6b7280; }
.delivery-empty { color:#9aa1ad; font-size:13px; padding:18px; text-align:center; border:1px dashed #d9dde6; border-radius:8px; background:#fafbff; }
.delivery-empty-large { padding:36px 12px; }
.order-flow-requirement label { display:block; font-size:13px; color:#374151; font-weight:600; margin-bottom:6px; }
.order-flow-columns { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; }
.order-flow-upload-section { display:flex; flex-direction:column; gap:10px; margin-bottom:10px; }
.order-flow-section-head b { display:block; color:#1f2937; }
.order-flow-section-head span { display:block; color:#6b7280; font-size:12px; margin-top:2px; }
@media (max-width: 900px) { .order-flow-columns { grid-template-columns:1fr; } }

html, body { margin:0; padding:0; height:100%; font-family: "PingFang SC","Microsoft YaHei","Hiragino Sans GB","Segoe UI",sans-serif; background:#f4f6fa; color:#222; }

.layout { display:flex; min-height:100vh; }
.sidebar { width:220px; background:linear-gradient(180deg,#1f2a44 0%,#2a3654 100%); color:#dde3f0; padding:0; display:flex; flex-direction:column; flex-shrink:0; }
.sidebar .brand { padding:20px 18px; font-size:16px; font-weight:600; color:#fff; border-bottom:1px solid rgba(255,255,255,.08); display:flex; align-items:center; gap:8px; }
.sidebar nav { flex:1; padding:10px 0; }
.sidebar nav a { display:flex; align-items:center; gap:10px; padding:11px 18px; color:#dde3f0; text-decoration:none; font-size:14px; transition: background .15s; }
.sidebar nav a i { width:18px; }
.sidebar nav a:hover { background:rgba(255,255,255,.06); color:#fff; }
.sidebar nav a.active { background:#3d5fff; color:#fff; }
.sidebar .footer { padding:14px 18px; font-size:12px; color:rgba(255,255,255,.45); border-top:1px solid rgba(255,255,255,.08); }

.main { flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar { height:54px; background:#fff; border-bottom:1px solid #e6e9ef; display:flex; align-items:center; justify-content:space-between; padding:0 22px; }
.topbar #page-title { font-size:16px; font-weight:600; }
.topbar-right { color:#888; font-size:13px; }

.view { flex:1; padding:20px 22px; overflow:auto; }

/* 看板卡片 */
.cards { display:grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:20px; }
.card-stat { background:#fff; border-radius:8px; padding:16px 18px; border:1px solid #ecf0f5; box-shadow:0 1px 2px rgba(0,0,0,.02); }
.card-stat .label { color:#888; font-size:13px; }
.card-stat .value { font-size:24px; font-weight:600; margin-top:6px; color:#222; }
.card-stat .sub { color:#999; font-size:12px; margin-top:4px; }
.card-stat.accent .value { color:#3d5fff; }
.card-stat.success .value { color:#16a34a; }
.card-stat.warn .value { color:#d97706; }

/* 工具条 */
.toolbar { display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.toolbar .left { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.toolbar .right { margin-left:auto; display:flex; gap:8px; align-items:center; }
.toolbar input.form-control, .toolbar select.form-select { width:auto; }

/* 表格 */
.table-card { background:#fff; border-radius:8px; border:1px solid #ecf0f5; overflow:hidden; }
.table-wrap { overflow:auto; max-height: calc(100vh - 220px); }
.table-wrap table { width:100%; border-collapse:collapse; font-size:13px; min-width:max-content; }
.table-wrap thead th { background:#f7f9fc; color:#555; padding:10px 12px; text-align:left; font-weight:600; border-bottom:1px solid #e6e9ef; position:sticky; top:0; z-index:1; white-space:nowrap; }
.table-wrap tbody td { padding:9px 12px; border-bottom:1px solid #f0f3f8; vertical-align: top; }
.table-wrap tbody tr:hover { background:#fafbff; }
.table-wrap tbody tr.row-total td { background:#f7f9fc; border-top:1px solid #d6dae3; font-weight:600; }
.table-wrap tbody tr.row-total:hover td { background:#eef1f6; }
.th-sort-btn { border:0; background:transparent; color:inherit; font:inherit; font-weight:600; padding:0; display:inline-flex; align-items:center; gap:4px; white-space:nowrap; cursor:pointer; }
.th-sort-btn:hover,
.th-sort-btn.active { color:#2563eb; }
.th-sort-mark { color:#94a3b8; font-size:11px; line-height:1; min-width:10px; text-align:center; }
.th-sort-btn.active .th-sort-mark { color:#2563eb; }
.field-disabled label { color:#9aa1ad; }
.field-disabled .role-hint { color:#dc2626; font-size:11px; margin-left:4px; font-weight:500; }
.field-disabled input:disabled, .field-disabled select:disabled, .field-disabled textarea:disabled { background:#f3f4f8; color:#7b818c; cursor:not-allowed; }
/* 数字列与文本列同样左对齐, 表头汉字和单元格内数字垂直对齐;
   tabular-nums 保留, 让数字位宽一致便于纵向比较 */
.table-wrap td.num { text-align:left; font-variant-numeric: tabular-nums; }
.table-wrap td.actions { white-space:nowrap; }
/* 操作列固定在右侧, 避免横向滚动后看不到 编辑/删除 按钮 */
.table-wrap thead th:last-child,
.table-wrap tbody td:last-child.actions {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -3px 0 6px -3px rgba(0,0,0,.08);
  z-index: 2;
}
.table-wrap thead th:last-child { background:#f7f9fc; z-index: 3; }
.table-wrap tbody tr:hover td:last-child.actions { background:#fafbff; }
.badge-pill { display:inline-block; padding:2px 8px; border-radius:10px; font-size:12px; }
.badge-green { background:#dcfce7; color:#166534; }
.badge-red { background:#fee2e2; color:#991b1b; }
.badge-amber { background:#fef3c7; color:#92400e; }
.badge-gray { background:#e5e7eb; color:#374151; }
.badge-blue { background:#dbeafe; color:#1e40af; }
.test-return-select { min-width:74px; height:28px; padding:2px 22px 2px 8px; border-radius:6px; border:1px solid #d9dde6; font-size:12px; font-weight:600; color:#374151; background-color:#fff; }
.test-return-select.return-wait { background-color:#fff; color:#374151; border-color:#d9dde6; }
.test-return-select.return-done { background-color:#dcfce7; color:#166534; border-color:#86efac; }
.test-return-select.return-modify { background-color:#fee2e2; color:#991b1b; border-color:#fecaca; }
.test-return-select:disabled { opacity:.68; cursor:not-allowed; }

.empty { text-align:center; color:#999; padding:40px 0; }

/* ----- 分页器 ----- */
.pager { display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:10px 12px; border-top:1px solid #ecf0f5; background:#fafbfd; font-size:13px; color:#555; }
.pager .pg-info { margin-right:auto; color:#666; }
.pager .pg-info b { color:#1f2937; font-weight:600; }
.pager .pg-size-select { width:auto; min-width:88px; height:30px; padding:0 22px 0 8px; font-size:12px; }
.pager .pg-btn, .pager .pg-num {
  min-width:30px; height:30px; padding:0 8px; border:1px solid #d9dde6; background:#fff;
  border-radius:6px; color:#374151; cursor:pointer; font-size:13px; line-height:1;
  font-variant-numeric: tabular-nums;
}
.pager .pg-btn:hover:not(:disabled), .pager .pg-num:hover { border-color:#3d5fff; color:#3d5fff; background:#f0f4ff; }
.pager .pg-btn:disabled { color:#bbb; background:#f5f5f7; cursor:not-allowed; }
.pager .pg-num.active { background:#3d5fff; border-color:#3d5fff; color:#fff; font-weight:600; }
.pager .pg-num.active:hover { background:#3d5fff; color:#fff; }
.pager .pg-ellipsis { padding:0 4px; color:#999; }
.pager .pg-jump { display:inline-flex; align-items:center; gap:4px; margin-left:6px; color:#666; }
.pager .pg-jump-input { width:60px; height:30px; padding:2px 6px; text-align:center; font-size:13px;
  border:1px solid #d9dde6; border-radius:6px; }
.pager .pg-jump-input:focus { outline:none; border-color:#3d5fff; box-shadow:0 0 0 2px rgba(61,95,255,.15); }
/* 表格卡片里放分页器: 让滚动区不再吃掉它 */
.table-card { display:block; }
.table-card .table-wrap + .pager { border-top-color:#ecf0f5; }

/* 表单 */
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap:12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { font-size:13px; color:#555; display:block; margin-bottom:4px; }
.form-grid input, .form-grid select, .form-grid textarea { width:100%; }
.dup-hint { font-size:12px; color:#dc2626; margin-top:4px; min-height:14px; }
/* 可搜索下拉 (search-select): 输入框 + 浮动选项列表 */
.search-select-wrap { position:relative; }
.search-select-list {
  position:absolute; z-index:1080; top:100%; left:0; right:0;
  max-height:240px; overflow-y:auto;
  background:#fff; border:1px solid #d9dde6; border-top:none;
  border-radius:0 0 6px 6px; box-shadow:0 6px 16px rgba(0,0,0,0.08);
}
.ss-item { padding:6px 10px; font-size:14px; cursor:pointer; line-height:1.4; }
.ss-item:hover { background:#eef2ff; }
/* 多选角色: 横向 checkbox 列表 */
.multi-check { display:flex; flex-wrap:wrap; gap:8px 14px; padding:6px 0; }
.multi-item { display:flex; align-items:center; gap:5px; font-size:13px; cursor:pointer; user-select:none; padding:3px 8px; border:1px solid #e6e9ef; border-radius:14px; background:#f7f9fc; }
.multi-item input { margin:0; }
.multi-item:has(input:checked) { background:#dbeafe; border-color:#3d5fff; color:#1e40af; }

/* Toast */
.toast-msg { position:fixed; right:20px; top:20px; background:#222; color:#fff; padding:10px 14px; border-radius:6px; opacity:0; transform:translateY(-10px); transition:all .25s; z-index:9999; pointer-events:none; }
.toast-msg.show { opacity:1; transform:translateY(0); }
.toast-msg.error { background:#dc2626; }
.toast-msg.success { background:#16a34a; }

/* 子区块 */
.section-title { font-size:14px; font-weight:600; margin:18px 0 10px; color:#333; display:flex; align-items:center; gap:8px; }
.section-title i { color:#3d5fff; }
.section-sub { font-size:13px; font-weight:500; margin:14px 0 8px; color:#555; display:flex; align-items:center; gap:6px; }
.section-sub i { color:#888; }
/* 柱状图卡片 */
.chart-card { background:#fff; border-radius:8px; border:1px solid #ecf0f5; padding:14px 16px 18px; box-shadow:0 1px 2px rgba(0,0,0,.02); margin-bottom:14px; position:relative; height:300px; }
.chart-card canvas { max-width:100%; }
.chart-card .chart-title { font-size:13px; font-weight:500; color:#555; margin-bottom:6px; }
.chart-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(360px,1fr)); gap:14px; margin-bottom:14px; }
.kv { display:grid; grid-template-columns: max-content 1fr; gap:6px 14px; font-size:13px; }

/* 客户查重 */
.cc-empty { text-align:center; color:#999; padding:60px 0; font-size:14px; }
.cc-empty.notfound { color:#dc2626; font-weight:600; font-size:16px; }
.cc-summary { font-size:13px; color:#16a34a; font-weight:600; margin:4px 0 14px; display:flex; align-items:center; gap:6px; }
.cc-card { background:#fff; border:1px solid #ecf0f5; border-radius:8px; box-shadow:0 1px 2px rgba(0,0,0,.02); margin-bottom:16px; overflow:hidden; }
.cc-card-head { padding:14px 18px 12px; border-bottom:1px solid #ecf0f5; background:#fafbfd; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.cc-card-head .cc-name { font-size:16px; font-weight:600; color:#1f2937; display:flex; align-items:center; gap:8px; }
.cc-card-head .cc-name i { color:#3d5fff; }
.cc-card-head .cc-tags { margin-left:auto; display:flex; gap:6px; flex-wrap:wrap; }
.cc-info { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap:12px 22px; padding:14px 18px 16px; border-bottom:1px solid #ecf0f5; }
.cc-info .cc-i-label { font-size:12px; color:#94a3b8; margin-bottom:3px; letter-spacing:.2px; }
.cc-info .cc-i-value { font-size:13.5px; color:#1f2937; font-weight:500; word-break:break-all; }
.cc-info .cc-i-value.muted { color:#9ca3af; font-weight:400; }
.cc-tests-title { padding:12px 18px 8px; font-size:13px; font-weight:600; color:#475569; display:flex; align-items:center; gap:6px; }
.cc-tests-title i { color:#64748b; }
.cc-card .table-wrap { max-height: 360px; }
.cc-card .table-wrap thead th { background:#f1f5f9; }
.cc-no-tests { padding:14px 20px 20px; color:#94a3b8; font-size:13px; }
.kv .k { color:#888; }

/* 紧凑按钮 */
.btn-xs { padding:2px 9px; font-size:12px; }

/* 登录页 */
.login-page { position:fixed; inset:0; background: linear-gradient(135deg,#1f2a44 0%,#3d5fff 100%); display:flex; align-items:center; justify-content:center; z-index:9000; }
.login-card { background:#fff; border-radius:14px; padding:36px 38px; width:380px; max-width:92vw; box-shadow:0 24px 48px rgba(0,0,0,.25); }
.login-brand { display:flex; align-items:center; gap:14px; margin-bottom:24px; }
.login-brand i { font-size:34px; color:#3d5fff; }
.login-brand .t1 { font-size:18px; font-weight:700; color:#222; }
.login-brand .t2 { font-size:13px; color:#888; }
.login-error { color:#dc2626; font-size:13px; margin-bottom:10px; min-height:20px; }
.login-foot { text-align:center; margin-top:18px; color:#bbb; font-size:12px; }

/* 用户区 */
#user-area { color:#dde3f0; }
#user-area .user-name { font-size:13px; font-weight:600; color:#fff; }
#user-area .user-role { font-size:12px; color:rgba(255,255,255,.5); margin-top:2px; }

.sidebar nav a.hidden { display:none !important; }

/* ===================== 数据驾驶舱 大屏 ===================== */
/* 主要要点: 命名空间 .cockpit-screen 包裹所有样式, 避免污染其他页面;
   深蓝科技风, 霓虹色系, 网格化布局, 一屏铺满, 内部容器各自滚动 */
.cockpit-screen { color:#cfe2ff; background: radial-gradient(ellipse at top, #0c2148 0%, #061029 55%, #03081a 100%); padding:0; margin:-20px -22px; height: calc(100vh - 54px); overflow:hidden; display:flex; flex-direction:column; }
.cockpit-screen * { box-sizing:border-box; }

/* 顶部条 */
.cs-header { display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; padding:16px 28px; border-bottom:1px solid rgba(80,140,255,.18); background: linear-gradient(180deg, rgba(20,60,140,.35) 0%, rgba(20,60,140,0) 100%); position:relative; }
.cs-header::after { content:""; position:absolute; left:50%; bottom:-1px; width:60%; height:2px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, #00d9ff 50%, transparent); opacity:.5; }
.cs-header .cs-brand { font-size:14px; color:#7fb3ff; display:flex; align-items:center; gap:8px; letter-spacing:1px; }
.cs-header .cs-brand i { color:#00d9ff; font-size:18px; }
.cs-header .cs-title { font-size:24px; font-weight:700; color:#fff; letter-spacing:6px; text-align:center; text-shadow: 0 0 12px rgba(0,217,255,.55); }
.cs-header .cs-time { justify-self:end; color:#9bbbe6; font-size:14px; display:flex; align-items:center; gap:14px; }
.cs-header .cs-time .cs-clock { font-size:22px; color:#fff; font-variant-numeric: tabular-nums; letter-spacing:2px; }

/* 内容区: 3 列 × 3 行 grid, 按行优先填充; minmax(0,1fr) 阻止内容撑高行 */
.cs-body { flex:1; min-height:0; overflow:hidden;
  display:grid;
  grid-template-columns: 1fr 1.4fr 1.4fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  gap:10px; padding:10px 14px 14px;
}
/* 测试转化漏斗: 倒金字塔三层 + 左侧"["形折线(总转化率) + 右侧两段"]"形折线(分步转化率) */
.cs-funnel-box { width:100%; height:100%; display:flex; align-items:center; justify-content:center; padding:4px 6px; }
.cs-funnel {
  width:100%; max-width:380px; height:100%;
  display:grid;
  grid-template-columns: 58px minmax(0,1fr) 58px;
  align-items:stretch;
  gap:2px;
}
/* 中列: 三层漏斗 */
.cs-fn-mid { display:flex; flex-direction:column; justify-content:space-around; align-items:center; padding:2px 0; }
/* 左/右两侧: flex 列, 利用 spacer 把折线两端对齐到对应层中心 (1/6, 3/6, 5/6 总高) */
.cs-fn-side { display:flex; flex-direction:column; padding:2px 0; }
.cs-fn-side-left  { align-items:flex-end;   }   /* 折线靠近中列, 徽章往外伸 */
.cs-fn-side-right { align-items:flex-start; }
.cs-fn-sp { flex:0.5; min-height:0; }
/* 折线本体: 三边边框 (上 / 侧 / 下), 形成 "[" 或 "]" 形, 缺口朝向漏斗 */
.cs-fn-tall, .cs-fn-step {
  position:relative; min-height:0; width:30px;
  border:2px solid rgba(0,217,255,.7);
  box-sizing:border-box;
}
.cs-fn-tall {                         /* 左侧总转化率: 跨 L1 中心 → L3 中心 */
  flex:2;
  border-right:none;                  /* "[" 形, 开口朝右 */
  border-radius:6px 0 0 6px;
}
.cs-fn-step {                         /* 右侧分步: 各跨一层中心到下一层中心 */
  flex:1;
  border-left:none;                   /* "]" 形, 开口朝左 */
  border-radius:0 6px 6px 0;
}
/* 徽章: 居于折线竖段中点, 跨在线上 (左侧居左竖线, 右侧居右竖线) */
.cs-fn-badge {
  position:absolute; top:50%; z-index:1;
  background: rgba(8,20,50,.95); color:#ffc857;
  font-size:11px; font-weight:600; padding:2px 8px; border-radius:10px;
  border:1px solid rgba(255,200,87,.55); white-space:nowrap;
  box-shadow: 0 0 8px rgba(255,200,87,.25);
  font-variant-numeric: tabular-nums;
}
.cs-fn-tall .cs-fn-badge { left:0;  transform:translate(-50%, -50%); }
.cs-fn-step .cs-fn-badge { right:0; transform:translate( 50%, -50%); }
.cs-fn-badge-total {
  background: linear-gradient(135deg, rgba(0,217,255,.92), rgba(61,95,255,.92));
  color:#fff; font-size:12px; padding:3px 10px;
  border-color: rgba(0,217,255,.6);
  box-shadow: 0 0 10px rgba(0,217,255,.4);
  letter-spacing:1px;
}
/* 漏斗层 (各层宽度相对于中列, 仍保持倒金字塔比例) */
.cs-funnel-layer {
  width:100%; padding:8px 14px; border-radius:4px; color:#fff; font-size:13px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  text-shadow: 0 1px 2px rgba(0,0,0,.35); letter-spacing:1px;
  position:relative;
}
.cs-funnel-layer.l1 { width:100%; background: linear-gradient(135deg, rgba(61,95,255,.92), rgba(0,217,255,.92)); box-shadow: 0 0 14px rgba(0,217,255,.35), inset 0 0 0 1px rgba(0,217,255,.7); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }
.cs-funnel-layer.l2 { width:76%; background: linear-gradient(135deg, rgba(0,217,255,.92), rgba(16,255,177,.92)); box-shadow: 0 0 14px rgba(16,255,177,.35), inset 0 0 0 1px rgba(16,255,177,.7); clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%); }
.cs-funnel-layer.l3 { width:54%; background: linear-gradient(135deg, rgba(255,200,87,.92), rgba(255,93,143,.92)); box-shadow: 0 0 14px rgba(255,200,87,.35), inset 0 0 0 1px rgba(255,200,87,.7); clip-path: polygon(0 0, 100% 0, 82% 100%, 18% 100%); }
.cs-funnel-layer .cs-fl-label { font-weight:500; }
.cs-funnel-layer .cs-fl-num   { font-weight:700; font-variant-numeric: tabular-nums; font-size:15px; }

/* 通用面板 */
.cs-panel { background: linear-gradient(180deg, rgba(15,40,90,.65) 0%, rgba(8,20,50,.85) 100%); border:1px solid rgba(80,140,255,.25); border-radius:6px; padding:8px 12px 10px; position:relative; display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.cs-panel::before, .cs-panel::after { content:""; position:absolute; width:10px; height:10px; border:1px solid #00d9ff; }
.cs-panel::before { top:-1px; left:-1px; border-right:0; border-bottom:0; }
.cs-panel::after  { bottom:-1px; right:-1px; border-left:0; border-top:0; }
.cs-panel .cs-panel-title { font-size:14px; color:#cfe2ff; font-weight:500; margin-bottom:8px; padding-left:10px; position:relative; letter-spacing:1px; flex-shrink:0; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.cs-panel .cs-panel-title::before { content:""; position:absolute; left:0; top:50%; transform:translateY(-50%); width:3px; height:14px; background: linear-gradient(180deg,#00d9ff,#3d5fff); }
.cs-panel .cs-panel-title .cs-pt-text { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cs-panel .cs-panel-body { flex:1; min-height:0; position:relative; overflow:hidden; display:flex; flex-direction:column; }

/* Period segmented toggle (本月 / 总数) */
.cs-toggle { display:inline-flex; border:1px solid rgba(0,217,255,.35); border-radius:3px; overflow:hidden; flex-shrink:0; background: rgba(8,20,50,.5); }
.cs-toggle button { background:transparent; border:0; color:#7fb3ff; font-size:11px; padding:3px 9px; cursor:pointer; letter-spacing:1px; line-height:1.4; transition: background .12s, color .12s; }
.cs-toggle button + button { border-left:1px solid rgba(0,217,255,.25); }
.cs-toggle button:hover { color:#fff; background: rgba(0,217,255,.08); }
.cs-toggle button.active { background: linear-gradient(135deg, rgba(0,217,255,.55), rgba(61,95,255,.5)); color:#fff; text-shadow:0 0 6px rgba(0,217,255,.6); }

/* KPI 卡片网格 - 自适应 2 列, 数量增加时允许内部上下滚动 */
.cs-kpi-grid { display:grid; grid-template-columns: 1fr 1fr; gap:6px; flex:1; min-height:0; overflow-y:auto; align-content:start; padding-right:2px; }
.cs-kpi { background: linear-gradient(135deg, rgba(0,217,255,.08) 0%, rgba(61,95,255,.12) 100%); border:1px solid rgba(0,217,255,.25); border-radius:4px; padding:8px 10px; display:flex; align-items:center; gap:8px; min-height:0; }
.cs-kpi .cs-kpi-icon { width:34px; height:34px; flex-shrink:0; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:16px; background: linear-gradient(135deg, rgba(0,217,255,.2), rgba(61,95,255,.3)); color:#00d9ff; border:1px solid rgba(0,217,255,.35); }
.cs-kpi .cs-kpi-meta { min-width:0; }
.cs-kpi .cs-kpi-label { font-size:11px; color:#9bbbe6; }
.cs-kpi .cs-kpi-value { font-size:18px; font-weight:700; color:#fff; font-variant-numeric: tabular-nums; line-height:1.1; margin-top:2px; text-shadow: 0 0 8px rgba(0,217,255,.4); }
.cs-kpi.green .cs-kpi-icon { color:#10ffb1; background: linear-gradient(135deg, rgba(16,255,177,.18), rgba(16,255,177,.05)); border-color: rgba(16,255,177,.4); }
.cs-kpi.green .cs-kpi-value { text-shadow: 0 0 8px rgba(16,255,177,.4); }
.cs-kpi.amber .cs-kpi-icon { color:#ffc857; background: linear-gradient(135deg, rgba(255,200,87,.18), rgba(255,200,87,.05)); border-color: rgba(255,200,87,.4); }
.cs-kpi.amber .cs-kpi-value { text-shadow: 0 0 8px rgba(255,200,87,.4); }
.cs-kpi.pink .cs-kpi-icon { color:#ff5d8f; background: linear-gradient(135deg, rgba(255,93,143,.18), rgba(255,93,143,.05)); border-color: rgba(255,93,143,.4); }
.cs-kpi.pink .cs-kpi-value { text-shadow: 0 0 8px rgba(255,93,143,.4); }

/* 排行榜 */
.cs-rank { display:flex; flex-direction:column; gap:6px; overflow-y:auto; padding-right:4px; flex:1; min-height:0; }
.cs-rank .cs-rank-row { display:grid; grid-template-columns: 22px 1fr auto; align-items:center; gap:8px; font-size:13px; padding:4px 0; }
.cs-rank .cs-rank-no { width:22px; height:22px; line-height:22px; text-align:center; color:#9bbbe6; font-weight:700; font-size:12px; background: rgba(80,140,255,.18); border-radius:3px; }
.cs-rank .cs-rank-row:nth-child(1) .cs-rank-no { background: linear-gradient(135deg,#ffd86b,#ff8a3d); color:#1a1a1a; }
.cs-rank .cs-rank-row:nth-child(2) .cs-rank-no { background: linear-gradient(135deg,#d6e6ff,#7fb3ff); color:#1a1a1a; }
.cs-rank .cs-rank-row:nth-child(3) .cs-rank-no { background: linear-gradient(135deg,#ffb98a,#d97706); color:#1a1a1a; }
.cs-rank .cs-rank-name { color:#cfe2ff; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; position:relative; }
.cs-rank .cs-rank-bar { position:absolute; left:0; right:0; bottom:-3px; height:3px; background: rgba(0,217,255,.08); border-radius:2px; overflow:hidden; }
.cs-rank .cs-rank-bar-fill { display:block; height:100%; background: linear-gradient(90deg,#00d9ff,#3d5fff); border-radius:2px; }
.cs-rank .cs-rank-val { color:#00d9ff; font-variant-numeric: tabular-nums; font-weight:600; }

/* 表格/简表 */
.cs-mini-table { width:100%; border-collapse: collapse; font-size:12px; color:#cfe2ff; }
.cs-mini-table thead th { color:#7fb3ff; font-weight:500; text-align:left; padding:4px 8px; border-bottom:1px solid rgba(80,140,255,.25); white-space:nowrap; background: rgba(15,40,90,.95); position:sticky; top:0; z-index:1; }
.cs-mini-table thead th.num { text-align:right; }
.cs-mini-table thead th.cs-th-sort { cursor:pointer; user-select:none; -webkit-user-select:none; }
.cs-mini-table thead th.cs-th-sort:hover { color:#cfe2ff; background: rgba(20,55,120,.95); }
.cs-mini-table thead th.cs-th-sort.active { color:#00d9ff; }
.cs-mini-table thead th .cs-th-arrow { display:inline-block; margin-left:4px; font-size:10px; color:#00d9ff; min-width:8px; }
.cs-mini-table tbody td { padding:6px 8px; border-bottom:1px dashed rgba(80,140,255,.12); }
.cs-mini-table tbody tr:hover td { background: rgba(0,217,255,.06); }
.cs-mini-table td.num { font-variant-numeric: tabular-nums; color:#fff; text-align:right; }

/* 销售/转化人/生成人业绩多维表格容器: 在 flex column panel-body 内撑满, 内部滚动 */
.cs-sales-perf-box { width:100%; flex:1; min-height:0; overflow-y:auto; padding-right:4px; }

/* canvas 容器: 100% 适应 panel-body, 不要 min-height 让它能跟随 grid row 缩小 */
.cs-chart-box { position:relative; width:100%; height:100%; flex:1; min-height:0; }
.cs-chart-box canvas { max-width:100%; }

/* 加载/空态 */
.cs-loading { color:#7fb3ff; padding:40px; text-align:center; }
.cs-empty { color:#5e7da8; padding:20px; text-align:center; font-size:12px; }

/* 大屏激活时, 顶栏与侧边栏的视觉过渡 (可选: 仅当前页面切深色 topbar) */
body.cockpit-active .topbar { background:#0a1a36; color:#cfe2ff; border-bottom-color:#1e3a6e; }
body.cockpit-active .topbar #page-title { color:#fff; }
body.cockpit-active .topbar-right { color:#7fb3ff; }
body.cockpit-active .view { padding:0; background:#03081a; }

/* 中等宽度自适应: < 1400px 略缩, 仍保持 3×3 一屏布局, 比例微调 */
@media (max-width: 1400px) {
  .cs-body { grid-template-columns: 1fr 1.3fr 1.3fr; gap:8px; padding:8px 10px 10px; }
  .cs-panel { padding:6px 10px 8px; }
  .cs-kpi .cs-kpi-value { font-size:18px; }
}
/* 窄屏 < 1000px: 解除一屏限制, 允许整屏滚动, 单列 */
@media (max-width: 1000px) {
  .cockpit-screen { height:auto; min-height: calc(100vh - 54px); overflow:auto; }
  .cs-body { grid-template-columns: 1fr; grid-template-rows: auto; grid-auto-flow: row; overflow:visible; }
  .cs-panel { min-height:200px; overflow:visible; }
  .cs-panel .cs-panel-body { overflow:visible; }
  .cs-header .cs-title { font-size:18px; letter-spacing:2px; }
  .cs-header { grid-template-columns: 1fr; gap:6px; text-align:center; }
  .cs-header .cs-time { justify-self:center; }
  .cs-header .cs-brand { justify-content:center; }
}
