:root {
  --brand: #1f3a8a;
  --brand-2: #2b4bb5;
  --accent: #2563eb;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e4e9f2;
  --text: #16203a;
  --muted: #6b7893;
  --ok: #0f9d58;
  --ok-bg: #e9f7ef;
  --warn: #b42318;
  --warn-bg: #fdecea;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 32, 58, 0.06), 0 6px 18px rgba(22, 32, 58, 0.05);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--accent); text-decoration: none; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 40px 20px;
  background:
    radial-gradient(900px 500px at 12% -10%, #dbe4ff 0%, transparent 60%),
    radial-gradient(800px 500px at 95% 8%, #e6f0ff 0%, transparent 55%),
    linear-gradient(180deg, #f7f9ff 0%, #eef2fa 100%);
}

.login-brand { display: flex; align-items: center; gap: 14px; text-align: left; }
.brand-mark svg { width: 52px; height: 52px; display: block; border-radius: 12px; box-shadow: 0 8px 20px rgba(31, 58, 138, 0.25); }
.brand-mark { width: 56px; height: 56px; flex: 0 0 auto; }
.brand-mark img { box-shadow: 0 8px 20px rgba(31, 58, 138, 0.25); }
.login-brand h1 { margin: 0; font-size: 26px; letter-spacing: 1px; color: var(--brand); }
.login-brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.login-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(22, 32, 58, 0.1);
  padding: 30px 28px 26px;
}
.login-card h2 { margin: 0; font-size: 20px; }
.login-tip { margin: 6px 0 22px; color: var(--muted); font-size: 13px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.form-error {
  margin: -4px 0 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13px;
}

.login-foot { color: #93a0b8; font-size: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13.5px;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #c9d3e5; background: #f8faff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-danger { color: var(--warn); border-color: #f3c7c2; }
.btn-danger:hover { background: var(--warn-bg); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2fa; color: var(--text); }

/* ---------------- 主框架 ---------------- */
.app { display: flex; min-height: 100vh; }

.side {
  width: 218px;
  flex: 0 0 218px;
  background: linear-gradient(180deg, #0e1729 0%, #131e35 100%);
  color: #cfd8ea;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 20px; }
.side-brand svg { width: 36px; height: 36px; border-radius: 9px; }
.side-brand-text strong { display: block; color: #fff; font-size: 15px; letter-spacing: .5px; }
.side-brand-text span { display: block; font-size: 11px; color: #7d8cab; margin-top: 1px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #b9c5dc;
  font-size: 14px;
  transition: all .15s;
}
.side-nav a svg { width: 18px; height: 18px; opacity: .85; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-nav a.active { background: linear-gradient(90deg, #2b4bb5, #3457c9); color: #fff; box-shadow: 0 6px 16px rgba(43, 75, 181, .35); }
.side-nav a.active svg { opacity: 1; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: #b9c5dc; font-size: 13px; }
.side-user svg { width: 16px; height: 16px; }
.side-user:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-user.active { background: rgba(255,255,255,.1); color: #fff; }
.side-logout { text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #7d8cab; cursor: pointer; font-size: 13px; }
.side-logout:hover { background: rgba(255,255,255,.06); color: #fff; }

.main { flex: 1; min-width: 0; padding: 22px 26px 40px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 21px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; }

/* ---------------- 卡片 / 表格 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-body { padding: 18px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 14px;
  background: #f8fafd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.list td { padding: 12px 14px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fafcff; }
.cell-name { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 20px; background: #eef2fa; color: #44526e; white-space: nowrap; }
.badge-original { background: #e8efff; color: #1f3a8a; }
.badge-distill { background: #eef2fa; color: #56657f; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 上传 ---------------- */
.dropzone {
  border: 1.5px dashed #c6d2e6;
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: #f2f7ff; }
.dropzone svg { width: 34px; height: 34px; color: var(--brand-2); opacity: .85; }
.dropzone .dz-title { margin-top: 8px; font-weight: 600; }
.dropzone .dz-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.dz-picked { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; background: #e8efff; border-radius: 8px; font-size: 13px; color: var(--brand); }

.upload-form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px; align-items: end; margin-top: 16px; }
.upload-form .field { margin: 0; }

/* ---------------- 任务 ---------------- */
.task-file-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 6px; }
.pick-card { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fbfcff; transition: all .15s; }
.pick-card:hover { border-color: #b9c8e4; }
.pick-card.on { border-color: var(--accent); background: #f2f7ff; box-shadow: 0 0 0 2px rgba(37,99,235,.1); }
.pick-card input { margin-top: 3px; }
.pick-card .pc-name { font-weight: 600; font-size: 13.5px; word-break: break-all; }
.pick-card .pc-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

.task-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid #eef2f8; }
.task-card:last-child { border-bottom: 0; }
.task-card h4 { margin: 0 0 4px; font-size: 15px; }
.task-card .tc-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-card .tc-actions { display: flex; gap: 8px; }

/* ---------------- 工作台 ---------------- */
.wb { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.wb-side { position: sticky; top: 22px; max-height: calc(100vh - 44px); display: flex; flex-direction: column; }
.wb-side .card { display: flex; flex-direction: column; max-height: calc(100vh - 44px); overflow: hidden; }
.wb-side-head { padding: 14px; border-bottom: 1px solid var(--line); }
.wb-side-head .row { display: flex; gap: 8px; }
.wb-side-head input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; outline: none; font-size: 13px; }
.wb-side-head input:focus { border-color: var(--accent); }
.filters { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.filters button { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; cursor: pointer; }
.filters button.on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }

.rec-list { overflow: auto; flex: 1; }
.rec-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #f0f3f9; cursor: pointer; }
.rec-item:hover { background: #f7faff; }
.rec-item.on { background: #eef4ff; box-shadow: inset 3px 0 0 var(--accent); }
.rec-item .no { font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.rec-item .mini { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.rec-item .right { display: flex; gap: 4px; align-items: center; flex: 0 0 auto; }

.wb-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.rec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px; }
.rec-head .no { font-size: 17px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.rec-head .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.rec-head .nav-btns { display: flex; gap: 6px; flex: 0 0 auto; }

/* 对话气泡 */
.dialog-card .card-head { cursor: pointer; }
.dialog-body { padding: 16px 18px; max-height: 42vh; overflow: auto; background: #f7f9fd; }
.dialog-body.collapsed { display: none; }
.bubble-row { display: flex; margin: 8px 0; }
.bubble-row.customer { justify-content: flex-start; }
.bubble-row.agent { justify-content: flex-end; }
.bubble-row.other { justify-content: center; }
.bubble { display: inline-block; max-width: 100%; width: fit-content; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; text-align: left; }
.customer .bubble { background: #fff; border: 1px solid #e2e8f3; border-bottom-left-radius: 4px; }
.agent .bubble { background: #2b4bb5; color: #fff; border-bottom-right-radius: 4px; }
.other .bubble { background: #eef2fa; color: var(--muted); font-size: 12px; border-radius: 8px; }
.bubble-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.customer .bubble-wrap, .agent .bubble-wrap { min-width: 0; max-width: 76%; }
.agent .bubble-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.agent .bubble-label { color: #7d8cab; }
.dialog-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }

/* 质检项对比 */
.items { display: flex; flex-direction: column; gap: 12px; }
.item-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item-card.differ { border-color: #f3c7c2; box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.05); }
.item-card.same { border-color: #cfe9db; }
.item-card.annotated { border-color: #c7d5f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.06); }
.item-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #eef2f8; background: #fbfcff; }
.item-head h4 { margin: 0; font-size: 14.5px; }
.item-head .spacer { flex: 1; }
.item-head .ann-hint { color: var(--muted); font-size: 12px; }

.val-rows { display: flex; flex-direction: column; }
.val-row { display: grid; grid-template-columns: 128px 56px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 16px; border-bottom: 1px solid #f2f5fa; }
.val-row:last-child { border-bottom: 0; }
.val-row .file-chip { display: flex; flex-direction: column; gap: 3px; }
.val-row .file-chip .fname { font-size: 12px; color: var(--muted); word-break: break-all; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 13px; }
.pill-yes { background: var(--ok-bg); color: var(--ok); }
.pill-no { background: var(--warn-bg); color: var(--warn); }
.pill-empty { background: #eef2fa; color: var(--muted); font-weight: 500; }
.reason { font-size: 12.5px; line-height: 1.7; color: #3b4a66; white-space: pre-wrap; word-break: break-word; max-height: 92px; overflow: hidden; position: relative; }
.reason.expanded { max-height: none; }
.reason-toggle { border: 0; background: transparent; color: var(--accent); font-size: 12px; cursor: pointer; padding: 0; margin-top: 4px; }
.adopt-btn { align-self: start; }
.val-row.adopted { background: #f3f8ff; }

.ann-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; background: #f3f8ff; border-top: 1px solid #dbe7fb; }
.ann-row .ann-tag { font-size: 12px; color: var(--brand); font-weight: 700; flex: 0 0 auto; padding-top: 1px; }
.ann-row .ann-content { flex: 1; min-width: 0; }
.ann-row .ann-result { font-weight: 700; font-size: 13px; }
.ann-row .ann-reason { color: #3b4a66; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; margin-top: 3px; }
.ann-row .ann-actions { display: flex; gap: 4px; flex: 0 0 auto; }

.ann-editor { padding: 12px 16px; background: #f3f8ff; border-top: 1px solid #dbe7fb; display: grid; gap: 8px; }
.ann-editor .ed-row { display: flex; gap: 8px; align-items: center; }
.ann-editor select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.ann-editor textarea { width: 100%; min-height: 96px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; resize: vertical; font-size: 12.5px; }

/* 统计 */
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { padding: 6px 12px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.stat b { color: var(--text); font-size: 14px; margin-left: 4px; }
.stat.warn b { color: var(--warn); }
.stat.ok b { color: var(--ok); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(12, 20, 36, .45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal { background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(10, 18, 35, .28); width: min(760px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.radio-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.radio-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.radio-item.on { border-color: var(--accent); background: #f3f8ff; }
.radio-item .ri-name { font-weight: 600; font-size: 13.5px; }
.radio-item .ri-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.check-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.check-row label { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; color: #3b4a66; cursor: pointer; }
.preview-box { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafd; overflow: hidden; }
.preview-box .pb-head { padding: 8px 12px; font-size: 12px; color: var(--muted); background: #f0f4fa; display: flex; justify-content: space-between; }
.preview-box pre { margin: 0; padding: 12px; max-height: 260px; overflow: auto; font-size: 12px; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #2b3a56; }
.warn-note { margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--amber-bg); color: #7c4a03; font-size: 12.5px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: #16203a; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(10,18,35,.3); z-index: 90; max-width: 80vw; }
.toast.err { background: #a32217; }
.toast.ok { background: #10794a; }

/* 账号页 */
.account-card { max-width: 520px; }
.kv { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eef2f8; font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); width: 90px; flex: 0 0 auto; }

.loading { color: var(--muted); font-size: 13px; padding: 24px; text-align: center; }

/* logo */
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
.side-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; }

/* 勾选框恢复正常大小 */
.pick-card input[type="checkbox"] { width: 15px; height: 15px; margin: 2px 0 0; padding: 0; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }
.row-inline { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 12.5px; }

/* ---------------- 三栏标注工作台 ---------------- */
.wb3 { display: grid; grid-template-columns: 250px minmax(0, 1.05fr) minmax(360px, 0.95fr); gap: 14px; align-items: stretch; height: calc(100vh - 236px); min-height: 520px; }
.wb3-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.wb3-id { padding: 0; }
.wb3-id .wb-side-head { flex: 0 0 auto; }
.wb3-id .rec-list { overflow: auto; flex: 1; }
.wb3-mid { padding: 0; }
.wb3-mid .rec-head { flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.wb3-mid .dialog-body { flex: 1; max-height: none; overflow: auto; }
.wb3-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.cmp-card { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.cmp-scroll { overflow: auto; min-height: 0; }
.cmp-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.cmp-head h3 { margin: 0; font-size: 14px; }
.cmp-head .spacer { flex: 1; }
.cmp-items { display: flex; flex-direction: column; }
.cmp-item { border-bottom: 1px solid #eef2f8; cursor: pointer; }
.cmp-item:hover { background: #f9fbff; }
.cmp-item.on { background: #f2f7ff; box-shadow: inset 3px 0 0 var(--accent); }
.cmp-item.differ { background: #fffafa; }
.cmp-item.differ:hover { background: #fdf5f4; }
.cmp-item-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px 4px; }
.cmp-item-head h4 { margin: 0; font-size: 13.5px; }
.cmp-item-head .spacer { flex: 1; }
.cmp-item-head .ann-hint { color: var(--muted); font-size: 11.5px; }
.cmp-rows { padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.cmp-row { display: grid; grid-template-columns: auto 44px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.cmp-row .cmp-file { font-size: 11px; white-space: nowrap; }
.cmp-row.adopted { background: #eef5ff; border-radius: 6px; box-shadow: 0 0 0 1px #dbe7fb; }
.cmp-row .reason { max-height: 62px; font-size: 12px; line-height: 1.65; }
.cmp-row .reason.expanded { max-height: none; }
.cmp-ann { margin: 0 14px 10px; padding: 8px 10px; border-radius: 8px; background: #f3f8ff; border: 1px solid #dbe7fb; font-size: 12px; line-height: 1.6; color: #3b4a66; white-space: pre-wrap; word-break: break-word; }
.ann-pane { flex: 0 0 auto; max-height: 46%; overflow: auto; padding: 0; display: flex; flex-direction: column; }
.ann-pane-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.ann-pane-head h3 { margin: 0; font-size: 14px; }
.ann-form { padding: 12px 14px; display: grid; gap: 9px; }
.ann-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-top .ann-lab { font-size: 12.5px; color: var(--muted); }
.ann-form select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; }
.ann-form textarea { width: 100%; min-height: 104px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; resize: vertical; font-size: 12.5px; line-height: 1.7; }
.ann-form textarea:focus { border-color: var(--accent); outline: none; }
.ann-actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 1280px) {
  .wb3 { grid-template-columns: 220px minmax(0, 1fr) minmax(320px, 0.9fr); }
}
@media (max-width: 1080px) {
  .wb3 { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .wb3-id { max-height: 300px; }
  .wb3-mid { min-height: 360px; }
  .wb3-right { min-height: 480px; }
  .cmp-card { max-height: none; }
  .ann-pane { max-height: none; }
}
@media (max-width: 1080px) {
  .wb { grid-template-columns: 1fr; }
  .wb-side { position: static; max-height: none; }
  .wb-side .card { max-height: 340px; }
  .rec-list { max-height: 240px; }
}

@media (max-width: 820px) {
  .side { width: 64px; flex: 0 0 64px; padding: 14px 8px; }
  .side-brand-text, .side-nav a span, .side-user span, .side-logout { display: none; }
  .side-brand { justify-content: center; padding-bottom: 14px; }
  .side-nav a { justify-content: center; padding: 11px 0; }
  .side-user { justify-content: center; }
  .main { padding: 16px 14px 32px; }
  .val-row { grid-template-columns: 1fr; gap: 6px; }
  .upload-form { grid-template-columns: 1fr; }
}

/* 已标注记录：绿色标识 */
.rec-item.annotated { background: #f3fbf6; box-shadow: inset 3px 0 0 var(--ok); }
.rec-item.annotated:hover { background: #eaf8f0; }
.rec-item.annotated.on { background: #e4f7ec; box-shadow: inset 3px 0 0 var(--ok); }
.rec-item .presence { color: var(--brand-2, #2b4bb5); }

/* 依据列对齐：文件标签固定宽度 */
.cmp-row { grid-template-columns: 92px 44px minmax(0, 1fr) auto; }
.cmp-row .cmp-file { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; text-overflow: ellipsis; }
.ann-form textarea { width: 100%; min-height: 88px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; resize: vertical; font-size: 12.5px; font-family: inherit; line-height: 1.7; }

/* ---- 无效数据标记 ---- */
.rec-item.invalid { background: #f6f7f9; color: #98a2b3; }
.rec-item.invalid .no { text-decoration: line-through; }
.rec-item.invalid.on { background: #eef1f5; box-shadow: inset 3px 0 0 #98a2b3; }
.badge-danger { background: #fdecec; color: var(--warn); }

/* ---- 标注自动保存状态 ---- */
.ann-status { font-size: 12px; }
.ann-status.is-ok { color: var(--ok); }
.ann-status.is-err { color: var(--warn); font-weight: 600; }

/* ---- 对比结果：更宽松的排布 ---- */
.cmp-head { padding: 14px 18px; }
.cmp-item { border-bottom: none; }
.cmp-item + .cmp-item { border-top: 1px solid #f1f4fa; }
.cmp-item-head { padding: 15px 18px 9px; gap: 10px; }
.cmp-item-head h4 { font-size: 14px; }
.cmp-rows { padding: 6px 18px 16px; gap: 13px; }
.cmp-row { grid-template-columns: 92px 46px minmax(0, 1fr) auto; gap: 12px; padding: 1px 0; }
.cmp-row .cmp-file { font-size: 11.5px; }
.cmp-row .reason { max-height: 104px; font-size: 12.5px; line-height: 1.78; }

/* ---- 录音分段条 ---- */
.seg-bar { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; }
.seg-bar::before, .seg-bar::after { content: ""; flex: 1; height: 1px; background: #e6ecf7; }
.seg-bar span { font-size: 11.5px; color: var(--muted); background: #f1f5fc; border: 1px solid #e6ecf7; border-radius: 999px; padding: 2px 12px; }

/* ---- 可复制 ID ---- */
.rec-head .no.copyable { cursor: copy; border-radius: 6px; padding: 1px 6px; margin-left: -6px; transition: background 0.15s; }
.rec-head .no.copyable:hover { background: #eef4ff; }
