/* 群里没接住的话（/#chat-catch）。底子用经营数据共用的 mgmt.css（mg-app / mg-bar / mg-table / mg-how），这里只补列表、汇总条和右侧面板。
   颜色只用 tokens.css 变量（UI 门禁）；状态色：bad 红 / warn 黄 / good 绿 / muted 灰。 */
[hidden] { display: none !important; }

.cc-bar { gap: 8px; flex-wrap: wrap; }
.cc-bar .mg-seg button { white-space: nowrap; }
.cc-n { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: var(--radius-full); font-size: 11px; line-height: 16px;
  background: var(--danger-bg); color: var(--danger-fg); font-weight: 600; }
.cc-bar .mg-seg button.on .cc-n { background: var(--surface); }
.cc-ctl { height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-primary);
  padding: 0 10px; font: inherit; font-size: 13px; }
input.cc-ctl { width: 190px; }
.cc-down { border: 1px solid var(--warning-border); background: var(--warning-bg); color: var(--warning-fg); border-radius: var(--radius-md);
  padding: 8px 12px; font-size: 13px; }

/* 汇总条 */
.cc-sum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.cc-chip { border: 1px solid var(--border); border-radius: var(--radius-full); padding: 2px 10px; white-space: nowrap; background: var(--surface); }
.cc-chip.bad { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-fg); }
.cc-chip.good { background: var(--success-bg); border-color: var(--success-border); color: var(--success-fg); }
.cc-chip.muted { color: var(--text-muted); }
.cc-sep { color: var(--border-strong); }
.cc-stat { white-space: nowrap; }
.cc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 3px 0 8px; vertical-align: 0; background: var(--text-disabled); }
.cc-dot.good { background: var(--success-fg); }
.cc-dot.warn { background: var(--warning-fg); }
.cc-dot.bad { background: var(--danger-fg); }
.cc-dot.muted { background: var(--border-strong); }

/* 列表：定宽、一格一行、放不下的「…」悬停看全文；表头吸在筛选条下面（top 由 JS 量了写上） */
.cc-list { table-layout: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.cc-list th { position: sticky; z-index: 5; white-space: nowrap; }
.cc-list th:nth-child(1) { width: 96px; }
.cc-list th:nth-child(2) { width: 150px; }
.cc-list th:nth-child(4) { width: 130px; }
.cc-list th:nth-child(5) { width: 190px; }
.cc-list td { height: 44px; vertical-align: middle; max-width: none; }
.cc-list td small { display: block; margin: 2px 0 0; font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.cc-list td.cc-text { overflow: hidden; text-overflow: ellipsis; }
.cc-list tbody tr { cursor: pointer; }
.cc-list tbody tr:hover td { background: var(--surface-hover); }
.cc-list tr.sel td { background: var(--surface-selected); }

.cc-pill { display: inline-block; border-radius: var(--radius-full); padding: 1px 8px; font-size: 12px; line-height: 18px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-sunken); color: var(--text-secondary); margin-right: 4px; }
.cc-pill.bad { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-fg); }
.cc-pill.warn { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-fg); }
.cc-pill.good { background: var(--success-bg); border-color: var(--success-border); color: var(--success-fg); }
.cc-pill.muted { color: var(--text-muted); }

/* 右侧面板：盖在列表上；z 高过吸顶条和表头 */
.cc-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 96vw); background: var(--surface); z-index: 30;
  border-left: 1px solid var(--border); box-shadow: var(--shadow-3); overflow-y: auto; }
.cc-ph { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; }
.cc-ph-t { flex: 1 1 auto; min-width: 0; }
.cc-ph h2 { margin: 0; font-size: 17px; }
.cc-p-meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.cc-x { flex: none; border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 2px 6px; }
.cc-x:hover { color: var(--text-primary); }
.cc-pb { padding: 10px 16px 40px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.cc-box { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; }
.cc-box h3 { margin: 0 0 6px; font-size: 13px; color: var(--text-secondary); display: flex; gap: 6px; align-items: center; }
.cc-box p { margin: 4px 0; line-height: 1.6; }
.cc-quote small { color: var(--text-muted); margin-left: 6px; }
.cc-more { color: var(--text-secondary); }
.cc-meta { color: var(--text-muted); font-size: 12px; }
.cc-nudge { border-style: dashed; border-color: var(--info-border); background: var(--info-bg); }

.cc-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cc-msgs li { display: grid; grid-template-columns: 78px 1fr; gap: 0 8px; padding: 4px 6px; border-radius: 6px; }
.cc-msgs li.ours { background: var(--surface-sunken); }
.cc-msgs li.bot { color: var(--text-muted); }
.cc-msgs li.ref { box-shadow: inset 3px 0 0 var(--warning-fg); background: var(--warning-bg); }
.cc-m-at { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cc-m-who { font-size: 12px; color: var(--text-secondary); }
.cc-m-text { grid-column: 2; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 640px) {
  input.cc-ctl { width: 100%; font-size: 16px; }
  select.cc-ctl { font-size: 16px; }
  .cc-bar .mg-seg { display: flex; flex-wrap: wrap; width: 100%; }
  .cc-bar .mg-seg button { flex: 1 1 auto; white-space: normal; }
  .cc-stat { white-space: normal; }
  /* 手机只留三列：工厂 / 工厂说了什么 / 后来（时间、该谁接点开右边看） */
  .cc-list th:nth-child(1), .cc-list td:nth-child(1), .cc-list th:nth-child(4), .cc-list td:nth-child(4) { display: none; }
  .cc-list th:nth-child(2) { width: 72px; }
  .cc-list th:nth-child(5) { width: 104px; }
  .cc-list td { white-space: normal; }
  .cc-list td.cc-text { padding-top: 8px; padding-bottom: 8px; }
}
