/* 群聊采集工作台：按任务选群，先核对三列，再阅读相关证据。 */

#page-collection { max-width: 1320px; margin: auto; }
#page-collection > .section-head {
  padding: 30px 34px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: radial-gradient(circle at 88% 16%, #397b6a 0, transparent 32%),
    linear-gradient(120deg, #123c35, #205f51);
  margin-bottom: 18px;
  box-shadow: 0 14px 28px #153e3220;
}
#page-collection > .section-head .eyebrow { color: #a8d7c5; letter-spacing: .18em; }
#page-collection > .section-head h1 { color: #fff; font-size: clamp(29px, 3vw, 39px); letter-spacing: -.04em; margin: 0 0 10px; }
#page-collection > .section-head p { max-width: 600px; margin: 0; color: #d5e8df; line-height: 1.7; }
#page-collection > .section-head .actions { align-self: flex-end; }
#page-collection > .section-head .actions .button,
#page-collection > .section-head .actions button { background: #ffffff16; border-color: #ffffff70; color: #fff; }
#page-collection > .section-head .actions .button:hover,
#page-collection > .section-head .actions button:hover { background: #ffffff2b; }
#page-collection .cr-panel { border-radius: 18px; border-color: #dce8df; box-shadow: 0 8px 24px rgba(20, 60, 48, .045); }
#page-collection .cr-panel-head { padding: 18px 24px; background: #fff; }
#page-collection .cr-section, #page-collection .cr-form { padding: 24px; }
#page-collection .cr-group-heading h2 { font-size: 11px; color: #6c8377; font-weight: 700; letter-spacing: .12em; }
#page-collection .cr-group-heading strong { font-size: 18px; }
#page-collection .cr-cell-box { padding: 18px 20px; }
#page-collection .cr-cell-box strong { font-size: 17px; }
#page-collection .cr-form-grid { gap: 16px; }
.cr-adq {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 60px #10271e33;
}
.cr-adq::backdrop { background: #10271e66; }
.cr-adq .cr-step-head { justify-content: space-between; }
.cr-adq .cr-step-head h2 { margin: 0; }
.cr-adq .actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 8px; }
.cr-adq footer.actions { justify-content: flex-end; margin-top: 16px; }
.cr-adq input[type="file"] { max-width: 100%; }
.cr-adq-table { max-height: 320px; overflow: auto; }
#page-collection .cr-candidate { padding: 18px; }
#page-collection .cr-submit-preview { border-left: 3px solid var(--green); }
@media (max-width: 700px) {
  #page-collection > .section-head { padding: 24px; }
  #page-collection .cr-section, #page-collection .cr-form { padding: 16px; }
}

#page-collection .section-head { align-items: flex-start; }
#page-collection .section-head h1 { max-width: 18em; }
.cr-group-heading { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1; }
.cr-group-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.cr-filter-head { background: #fff; }
.cr-filter-head select { min-width: 150px; }
.cr-list-paging { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--line); }
.cr-list-paging span { margin-right: auto; font-size: 12px; }
.cr-submit-preview { flex: 1 1 300px; margin: 0; padding: 9px 12px; border-radius: 8px; background: #eef5f1; color: var(--ink); font-size: 13px; line-height: 1.5; }
.cr-cells-section { background: #fff; }
.cr-cells-section small { font-weight: 400; }
.cr-suggestions { margin-top: 16px; padding: 16px 18px; border: 1px solid #e4ece6; border-radius: 12px; background: #f7faf7; }
.cr-suggestions h4 { margin: 0 0 10px; font-size: 13px; color: #244c40; }
.cr-suggestions p { margin: 6px 0; font-size: 13px; line-height: 1.6; word-break: break-word; }
.cr-suggestions strong { margin-right: 5px; }
.cr-conflict { color: #9a4e18; font-weight: 600; }
.cr-evidence-section > p { margin: 0 0 12px; font-size: 12px; }

.cr-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.cr-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 17px 20px;
  border: 1px solid #dce8df;
  border-radius: 14px;
  background: #fff;
}
.cr-chip-label {
  font-size: 12px;
  color: #637d6f;
}
.cr-chip-value {
  font-size: 25px;
  line-height: 1.15;
  color: #173e34;
}
.cr-chip:nth-child(n+4) { padding: 12px 16px; flex-direction: row; align-items: center; justify-content: space-between; background: #f8faf8; }
.cr-chip:nth-child(n+4) .cr-chip-value { font-size: 13px; }
@media (max-width: 800px) { .cr-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 500px) { .cr-summary { grid-template-columns: 1fr 1fr; gap: 8px; } .cr-chip { padding: 13px; } }

.cr-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 14px;
}
.cr-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
  flex-wrap: wrap;
}
.cr-panel-head h2 {
  margin: 0;
  font-size: 16px;
}
.cr-panel-head p {
  margin: 0;
  font-size: 12px;
}
.cr-panel-head .tag {
  margin-left: auto;
}
.cr-panel-head input[type="search"] {
  flex: 1 1 240px;
  max-width: 320px;
  font-size: 13px;
  padding: 6px 10px;
}

/* ---------- 上：群列表 ---------- */
.cr-group-table {
  max-height: 420px;
  overflow: auto;
}
.cr-table-note { margin: 0; padding: 7px 14px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.cr-group-table table {
  width: 100%;
  min-width: 950px;
  table-layout: fixed;
}
.cr-group-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf1ec;
  font-size: 13px;
  font-weight: 700;
  color: #234d3e;
  text-align: left;
  padding: 12px 10px;
  line-height: 1.35;
}
.cr-group-table th:nth-child(1) { width: 34px; }
.cr-group-table th:nth-child(2) { width: 205px; }
.cr-group-table th:nth-child(3) { width: 140px; }
.cr-group-table th:nth-child(4) { width: 145px; }
.cr-group-table th:nth-child(5) { width: 160px; }
.cr-group-table th:nth-child(6) { width: 145px; }
.cr-group-table th:nth-child(7) { width: 120px; }
.cr-pick {
  text-align: center;
  vertical-align: middle;
}
.cr-pick input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.cr-pick input:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.cr-status-cell .tag {
  display: inline-block;
  margin: 2px 4px 2px 0;
}
/* 批量确认工具条：只影响左侧列表，不碰右侧正在填的表单 */
.cr-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7faf7;
}
.cr-batch-bar #cr-batch-state {
  font-size: 12px;
}
.cr-batch-bar button {
  font-size: 12px;
}
.cr-batch-bar #cr-batch-apply {
  margin-left: auto;
}
#cr-batch-why-box {
  margin: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
}
.cr-group-table td {
  padding: 11px 10px;
  vertical-align: top;
  border-top: 1px solid #eef2ee;
}
.cr-row {
  cursor: pointer;
}
.cr-row:hover {
  background: rgba(35, 95, 82, 0.05);
}
.cr-row:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}
.cr-row-active {
  background: rgba(35, 95, 82, 0.11);
}
.cr-who strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-who small {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-count {
  font-size: 13px;
}
.cr-count .muted {
  display: block;
  font-size: 11px;
}
.cr-field-value { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.cr-field-filled { color: #173e34; font-weight: 600; }

/* ---------- 下：详情 ---------- */
.cr-section {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2ee;
}
.cr-section h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: #183d34;
}
.cr-section h3 .muted {
  font-size: 12px;
  font-weight: 400;
}

/* 候选：宽屏两列、窄屏一列，卡片本身尽量扁 */
.cr-candidates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: 10px;
}
.cr-candidate {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid #dce7df;
  border-radius: 13px;
  padding: 10px 12px;
  background: #fcfdfb;
}
.cr-candidate-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cr-candidate-head .cr-use {
  margin-left: auto;
}
.cr-score {
  font-weight: 700;
  color: var(--green);
}
.cr-candidate-paging {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}
.cr-candidate p {
  margin: 0;
  font-size: 13px;
}
.cr-fields {
  display: grid;
  grid-template-columns: minmax(72px, max-content) 1fr;
  gap: 2px 10px;
  margin: 0;
  font-size: 13px;
}
.cr-fields dt {
  color: var(--muted);
}
.cr-fields dd {
  margin: 0;
  word-break: break-word;
}
.cr-candidate details {
  margin: 0;
}
.cr-candidate summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.cr-excerpt {
  margin: 6px 0 0;
  max-height: 200px;
  overflow: auto;
  padding: 8px;
  border-radius: 8px;
  background: var(--paper);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 三列现状：三个框横排，空的写「还没写」 */
.cr-cells-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.cr-cell-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf7;
}
.cr-cell-box.is-empty {
  border-style: dashed;
}
.cr-cell-box span {
  font-size: 12px;
  color: var(--muted);
}
.cr-cell-box strong {
  font-size: 14px;
  color: var(--ink);
  word-break: break-word;
}
.cr-cell-box.is-empty strong {
  color: var(--muted);
  font-weight: 400;
}

/* 写表表单 */
.cr-form {
  padding: 18px 14px;
  background: #f5faf6;
}
.cr-form h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.cr-form > p.muted { margin: 0 0 14px; font-size: 12px; }
.cr-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) {
  .cr-form-grid {
    grid-template-columns: 1fr;
  }
}
.cr-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.cr-form-grid select,
.cr-form-grid input {
  font-size: 14px;
}
.cr-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.cr-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* 绑定：群 ↔ 表里的行 */
.cr-binding {
  padding: 10px 14px;
  border-bottom: 1px solid #eef2ee;
}
.cr-binding-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cr-binding-head h3 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.cr-binding p {
  margin: 4px 0;
  font-size: 13px;
}
.cr-binding-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.cr-binding-tools input {
  flex: 1 1 200px;
  min-width: 140px;
}
.cr-bind-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  max-height: 160px;
  overflow: auto;
}
.cr-bind-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.cr-bind-option:hover {
  border-color: var(--green);
}
.cr-bind-option .muted {
  font-size: 12px;
}

/* 三步工作流：每个区块只承担一项操作。 */
.cr-page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.cr-page-title .eyebrow { margin: 0 0 8px; }
.cr-page-title h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); }
.cr-page-title .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cr-page-title .actions button, .cr-page-title .actions .button { padding: 8px 12px; font-size: 12px; }
#page-collection .cr-panel { margin-bottom: 16px; border-radius: 14px; box-shadow: 0 3px 14px #174b3510; }
.cr-step-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #f8fbf8; }
.cr-step-number { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: #235f52; color: #fff; font-size: 13px; font-weight: 700; }
.cr-step-head h2 { margin: 0 0 3px; font-size: 17px; color: #183e34; }
.cr-step-head p { margin: 0; color: #72867b; font-size: 12px; }
.cr-current-row { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.cr-current-copy { flex: 1; min-width: 0; }
.cr-current-copy h3 { margin: 0 0 5px; font-size: 18px; overflow-wrap: anywhere; }
.cr-current-copy p { margin: 0; font-size: 12px; }
.cr-current-row .tag { white-space: nowrap; }
.cr-current-row button { flex: 0 0 auto; }
.cr-filter-head { display: flex; align-items: center; gap: 10px; }
.cr-filter-head input[type="search"], .cr-filter-head select { height: 42px; margin: 0; padding: 8px 12px; box-sizing: border-box; }
.cr-filter-head input[type="search"] { flex: 1 1 270px; max-width: none; }
.cr-filter-head select { flex: 0 0 190px; min-width: 0; border: 1px solid #ccd7ce; border-radius: 8px; background: #fff; }
.cr-filter-head #cr-groups-count { margin-left: auto; white-space: nowrap; font-size: 12px; }
.cr-batch-bar { align-items: center; }
.cr-values .cr-form { padding: 22px; background: #fff; }
.cr-values .cr-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cr-values .cr-form-grid label { min-width: 0; font-size: 13px; color: #446256; font-weight: 600; }
.cr-values .cr-form-grid input, .cr-values .cr-form-grid select { display: block; width: 100%; height: 44px; margin: 8px 0 0; padding: 8px 12px; border: 1px solid #ccd7ce; border-radius: 8px; background: #fff; color: #183d34; font-size: 14px; }
.cr-values .cr-form-grid small { margin-top: 4px; font-size: 11px; font-weight: 400; }
.cr-values .cr-form-footer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 20px; }
.cr-values .cr-inline { white-space: normal; }
.cr-values .cr-inline input { width: auto; margin: 0; }
.cr-values-empty { margin: 0; padding: 24px 22px; color: var(--muted); }
.cr-evidence #cr-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 22px 0; padding: 0; border: 0; background: transparent; }
.cr-source-field { min-width: 0; padding: 14px 16px; border: 1px solid #dce8df; border-radius: 10px; background: #f8fbf8; }
.cr-source-field h3 { margin: 0 0 9px; font-size: 13px; }
.cr-source-option { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; font-size: 12px; }
.cr-source-option strong { font-size: 14px; word-break: break-word; }
.cr-source-option a { color: #236454; text-decoration: underline; }
.cr-source-more { grid-column: 1 / -1; margin: 0; color: #9a4e18; font-size: 12px; }
.cr-evidence #cr-candidates { margin: 18px 22px 0; }
.cr-evidence .cr-candidate-paging, .cr-evidence #cr-candidate-empty { margin: 14px 22px 20px; }
.cr-candidate { scroll-margin-top: 20px; }
.cr-candidate:target { outline: 2px solid #3b8c72; }
.cr-image-link { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; color: var(--green); font-size: 12px; }
.cr-image-link img { display: block; width: 96px; height: 72px; object-fit: cover; border: 1px solid #dce8df; border-radius: 8px; background: #eef2ed; }
.cr-materials-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.cr-materials-field legend { padding: 0; color: #446256; font-size: 13px; font-weight: 600; }
.cr-materials-options { display: flex; gap: 8px; margin: 8px 0 0; }
.cr-values .cr-form-grid .cr-materials-options label { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 7px; flex: 1; min-height: 44px; margin: 0; padding: 7px 10px; border: 1px solid #ccd7ce; border-radius: 8px; background: #fff; color: #36594b; cursor: pointer; white-space: nowrap; }
.cr-materials-options label:has(input:checked) { border-color: #26715e; background: #edf6ef; box-shadow: inset 0 0 0 1px #26715e; }
.cr-values .cr-form-grid .cr-materials-options input { display: inline-block; flex: 0 0 15px; width: 15px; height: 15px; margin: 0; padding: 0; accent-color: #235f52; }
.cr-evidence #cr-suggestions { display: flex; flex-direction: column; gap: 12px; }
.cr-evidence #cr-candidates[hidden] { display: none; }
.cr-evidence .cr-source-field { padding: 18px 20px; background: #fff; }
.cr-source-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid #e4ece6; }
.cr-evidence .cr-source-field h3 { margin: 0; font-size: 14px; }
.cr-source-count { flex: none; color: #627b6c; font-size: 12px; }
.cr-evidence .cr-source-option { display: block; margin: 0 0 10px; padding: 12px 14px; border-radius: 10px; background: #f7faf8; }
.cr-evidence .cr-source-option:last-child { margin-bottom: 0; }
.cr-source-value { display: inline-block; margin: 0 10px 6px 0; font-size: 15px; color: #173d34; }
.cr-field-evidence { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; padding: 14px 16px; border: 1px solid #dce7e0; border-left: 4px solid #6f9f8b; border-radius: 10px; background: #fff; }
.cr-evidence-image { border-left-color: #ad8958; background: #fffdf9; }
.cr-evidence-text { border-left-color: #4c968a; background: #fbfefd; }
.cr-evidence-head { display: flex; align-items: center; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid #e7eee9; }
.cr-evidence-index { color: #173d34; font-size: 12px; }
.cr-evidence-kind { padding: 3px 8px; border-radius: 5px; background: #e8f1ec; color: #2d6551; font-size: 11px; }
.cr-evidence-image .cr-evidence-kind { background: #f6ead8; color: #85632d; }
.cr-evidence-time { margin-left: auto; color: #688072; font-size: 11px; }
.cr-evidence-excerpt { margin: 0; padding: 10px 12px; border-left: 3px solid #78a997; border-radius: 0 6px 6px 0; background: #fff; color: #27473a; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.cr-evidence-reason { margin: 0; color: #345d4c; font-size: 12px; line-height: 1.6; }
.cr-evidence-model { margin: 0; color: #6c746c; font-size: 12px; line-height: 1.6; }
.cr-materials-field small { display: block; margin-top: 4px; }
@media (max-width: 800px) {
  .cr-page-title { align-items: flex-start; flex-direction: column; }
  .cr-filter-head { flex-wrap: wrap; }
  .cr-filter-head input[type="search"], .cr-filter-head select { flex: 1 1 200px; }
  .cr-values .cr-form-grid { grid-template-columns: 1fr; }
  .cr-values .cr-form-footer { grid-template-columns: 1fr; }
  .cr-evidence #cr-suggestions { grid-template-columns: 1fr; }
}
@media (max-width: 500px) { .cr-current-row { flex-wrap: wrap; } .cr-current-row button { width: 100%; } }

.cr-hint {
  margin: 0;
  padding: 6px 14px;
  font-size: 12px;
  color: #7a5b00;
  background: #fff8e6;
  border-bottom: 1px solid #f0e0b8;
}
