* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; margin: 0; background: #f5f5f7; color: #222; }
header { background: #fff; padding: 10px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 10; }
.topbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.title { font-weight: 700; font-size: 18px; }
.account { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.account button { font-size: 13px; padding: 4px 10px; border: 1px solid #d0d0d6; background: #fff; border-radius: 4px; cursor: pointer; }
.page-tabs { display: flex; gap: 6px; margin-bottom: 8px; border-bottom: 1px solid #ececf0; }
.page-tabs button { border: 0; background: transparent; padding: 8px 10px; cursor: pointer; color: #555; font-weight: 600; border-bottom: 2px solid transparent; }
.page-tabs button.active { color: #1f6feb; border-bottom-color: #1f6feb; }
.ctrls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.ctrls[hidden] { display: none; }
.ctrls .sep { display: inline-block; width: 1px; height: 18px; background: #ddd; margin: 0 6px; }
.ctrls select, .ctrls input[type=search] { font-size: 13px; padding: 4px 6px; border: 1px solid #d0d0d6; border-radius: 4px; }
.ctrls input[type=search] { min-width: 280px; }
.ctrls input.run-search { min-width: 180px; width: 220px; }
.ctrls button { font-size: 13px; padding: 4px 10px; border: 1px solid #d0d0d6; background: #fff; border-radius: 4px; cursor: pointer; }
.ctrls button.active { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.ctrls button:disabled { opacity: .45; cursor: not-allowed; }
#btn-ann-help { color: #1f4f91; }
.auth-user { color: #555; font-weight: 600; }
.scope-toggle input { accent-color: #1f6feb; }
.assign-control select { min-width: 140px; max-width: 180px; font-size: 13px; padding: 4px 6px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; }
.ann-task-context { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border: 1px solid #dfe3ea; border-radius: 4px; background: #f7f8fb; color: #333; font-weight: 600; }
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #eef1f5; }
.login-view[hidden] { display: none; }
.login-panel { width: min(360px, 100%); background: #fff; border: 1px solid #dfe3ea; border-radius: 8px; box-shadow: 0 10px 28px rgba(21,31,48,.12); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login-panel h1 { margin: 0 0 4px; font-size: 20px; line-height: 1.3; }
.login-panel label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #555; }
.login-panel input { height: 34px; border: 1px solid #cfd5df; border-radius: 4px; padding: 6px 8px; font-size: 14px; }
.login-panel input:focus { outline: 2px solid rgba(31,111,235,.18); border-color: #1f6feb; }
.login-panel button { height: 36px; border: 1px solid #1f6feb; border-radius: 4px; background: #1f6feb; color: #fff; font-weight: 700; cursor: pointer; }
.login-panel button:hover { background: #155bcb; }
.login-error { min-height: 18px; color: #c62828; font-size: 12px; line-height: 1.5; }
.metrics { font-size: 12px; color: #666; margin-top: 8px; font-family: ui-monospace, Menlo, monospace; }
.ann-help-modal { position: fixed; inset: 0; z-index: 240; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18, 24, 38, .42); }
.ann-help-modal[hidden] { display: none; }
.ann-help-panel { position: relative; width: min(980px, 100%); max-height: min(840px, calc(100vh - 32px)); overflow: auto; border-radius: 8px; background: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.25); padding: 24px 28px 28px; line-height: 1.7; }
.ann-help-panel h2 { font-size: 22px; line-height: 1.3; margin: 0 40px 10px 0; }
.ann-help-panel h3 { font-size: 16px; margin: 0 0 10px; }
.ann-help-panel ol, .ann-help-panel ul { margin: 0; padding-left: 22px; }
.ann-help-panel li { margin: 8px 0; }
.ann-help-lead { margin: 0 0 18px; color: #475467; font-size: 14px; }
.ann-help-section { margin-top: 16px; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fafbfc; }
.ann-help-subtext { margin-top: 4px; color: #475467; font-size: 13px; line-height: 1.7; }
.ann-help-table-wrap { margin: 12px 0; overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.ann-help-table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 13px; line-height: 1.65; }
.ann-help-table th, .ann-help-table td { padding: 10px 12px; border-bottom: 1px solid #eef0f4; text-align: left; vertical-align: top; }
.ann-help-table th { background: #f7f9fc; color: #344054; font-weight: 700; }
.ann-help-table tbody tr:last-child td { border-bottom: 0; }
.ann-help-table td:first-child { width: 120px; font-weight: 700; color: #1f2937; white-space: nowrap; }
.ann-help-panel code { padding: 1px 5px; border-radius: 4px; background: #eef2f7; color: #174ea6; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.ann-help-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; color: #555; font-size: 16px; cursor: pointer; }
.ann-help-close:hover { border-color: #1f6feb; color: #1f6feb; }
@media (max-width: 900px) {
  .ann-help-modal { align-items: stretch; padding: 10px; }
  .ann-help-panel { width: 100%; max-height: none; border-radius: 8px; padding: 18px 16px 22px; }
  .ann-help-panel h2 { font-size: 20px; }
  .ann-help-section { padding: 12px; }
  .ann-help-table { min-width: 640px; }
}
main { padding: 16px; }
.page-section[hidden] { display: none; }
.ann-loading { color: #666; padding: 18px 4px; }
.ann-empty-note { color:#4b5563; background:#f8fafc; border:1px solid #e5e7eb; border-radius:6px; padding:12px 14px; font-size:13px; line-height:1.6; }

.ptz-perf-panel { position: fixed; right: 12px; bottom: 12px; z-index: 10000; width: min(360px, calc(100vw - 24px)); max-height: min(72vh, 560px); overflow: auto; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(18,24,38,.94); color: #e5e7eb; box-shadow: 0 14px 36px rgba(0,0,0,.35); padding: 10px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ptz-perf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: #fff; }
.ptz-perf-head button { width: 24px; height: 24px; border: 1px solid rgba(255,255,255,.28); border-radius: 4px; background: transparent; color: #e5e7eb; cursor: pointer; }
.ptz-perf-head button:hover { background: rgba(255,255,255,.12); }
.ptz-perf-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-top: 1px solid rgba(255,255,255,.08); }
.ptz-perf-row span { color: #9ca3af; white-space: nowrap; }
.ptz-perf-row b { color: #e5e7eb; text-align: right; overflow-wrap: anywhere; font-weight: 600; }
.ptz-perf-row.warn b { color: #fca5a5; }
.ptz-perf-foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12); color: #9ca3af; }
.ptz-perf-foot code { color: #bfdbfe; }

.task-panel { background: #fff; border: 1px solid #dfe3ea; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.task-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.task-table th, .task-table td { padding: 9px 10px; border-bottom: 1px solid #eef0f4; text-align: left; vertical-align: middle; }
.task-table th { background: #f7f8fb; color: #555; font-weight: 700; white-space: nowrap; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table select { max-width: 170px; padding: 4px 6px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; font-size: 13px; }
.task-open-btn { padding: 4px 10px; border: 1px solid #1f6feb; border-radius: 4px; background: #fff; color: #1f6feb; cursor: pointer; font-weight: 600; }
.task-open-btn:hover { background: #1f6feb; color: #fff; }
.task-result-btn { display: inline-block; margin-left: 4px; padding: 4px 9px; border: 1px solid #6f42c1; border-radius: 4px; background: #fff; color: #6f42c1; cursor: pointer; font-weight: 600; text-decoration: none; }
.task-result-btn:hover { background: #6f42c1; color: #fff; }
.task-metrics-btn { margin-left: 4px; padding: 4px 9px; border: 1px solid #555; border-radius: 4px; background: #fff; color: #444; cursor: pointer; font-weight: 600; }
.task-metrics-btn:hover { background: #444; color: #fff; }
.task-assign-btn { margin-left: 4px; padding: 4px 9px; border: 1px solid #0f766e; border-radius: 4px; background: #fff; color: #0f766e; cursor: pointer; font-weight: 600; }
.task-assign-btn:hover { background: #0f766e; color: #fff; }
.task-review-btn { margin-left: 4px; padding: 4px 9px; border-radius: 4px; background: #fff; cursor: pointer; font-weight: 600; }
.task-review-btn.approve { border: 1px solid #2e7d32; color: #2e7d32; }
.task-review-btn.approve:hover { background: #2e7d32; color: #fff; }
.task-review-btn.reject { border: 1px solid #c62828; color: #c62828; }
.task-review-btn.reject:hover { background: #c62828; color: #fff; }
.task-muted { color: #888; }
.task-status { display: inline-block; padding: 2px 6px; border-radius: 999px; background: #eef0f5; color: #555; font-size: 12px; line-height: 1.4; }
.task-status.review_pending { background: #fff3e0; color: #e65100; }
.task-status.approved { background: #e8f5e9; color: #2e7d32; }
.task-status.rejected { background: #fde0e0; color: #c62828; }
.task-status.in_progress { background: #eef4ff; color: #1f4f91; }
.task-status.closed { background: #f1f3f5; color: #777; }
.task-mini { display: inline-block; margin: 1px 3px 1px 0; padding: 1px 5px; border-radius: 999px; background: #eef0f5; color: #555; font-size: 11px; line-height: 1.45; white-space: nowrap; }
.task-mini.ok { background: #e8f5e9; color: #2e7d32; }
.task-mini.warn { background: #fff3e0; color: #e65100; }
.task-mini.danger { background: #fde0e0; color: #c62828; }
.task-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 2px 0; color: #666; font-size: 13px; }
.task-page-btn { padding: 4px 10px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; cursor: pointer; font-weight: 600; }
.task-page-btn:hover:not(:disabled) { border-color: #1f6feb; color: #1f6feb; }
.task-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.ptz-toast-host { position: fixed; right: 14px; bottom: 14px; z-index: 12000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.ptz-toast { min-width: 220px; max-width: 360px; padding: 10px 12px; border-radius: 8px; background: rgba(22, 28, 45, .94); color: #fff; box-shadow: 0 12px 28px rgba(0,0,0,.24); font-size: 13px; line-height: 1.45; opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.ptz-toast.show { opacity: 1; transform: translateY(0); }
.ptz-toast.success { background: rgba(24, 110, 66, .96); }
.ptz-toast.error { background: rgba(167, 41, 32, .96); }
.task-metrics-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 88px 16px 24px; background: rgba(20, 24, 31, .32); }
.task-metrics-panel { width: min(760px, 100%); max-height: calc(100vh - 128px); overflow: auto; border: 1px solid #dfe3ea; border-radius: 8px; background: #fff; box-shadow: 0 18px 48px rgba(0,0,0,.18); padding: 14px; }
.task-assign-backdrop { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-start; justify-content: center; padding: 88px 16px 24px; background: rgba(20, 24, 31, .32); }
.task-assign-panel { width: min(460px, 100%); max-height: calc(100vh - 128px); overflow: auto; border: 1px solid #dfe3ea; border-radius: 8px; background: #fff; box-shadow: 0 18px 48px rgba(0,0,0,.18); padding: 14px; }
.task-assign-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.task-assign-head div { display: flex; flex-direction: column; gap: 2px; }
.task-assign-head span { color: #666; font-size: 12px; }
.task-assign-close { width: 28px; height: 28px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; cursor: pointer; }
.task-assign-close:hover { border-color: #0f766e; color: #0f766e; }
.task-assign-form { display: flex; flex-direction: column; gap: 12px; }
.task-assign-form label { display: flex; flex-direction: column; gap: 5px; color: #555; font-size: 12px; }
.task-assign-form select { min-height: 32px; padding: 5px 7px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; font-size: 13px; }
.task-assign-actions { display: flex; justify-content: flex-end; gap: 8px; }
.task-assign-save, .task-assign-cancel { padding: 4px 10px; border: 1px solid #0f766e; border-radius: 4px; background: #fff; color: #0f766e; cursor: pointer; font-weight: 600; }
.task-assign-save:hover { background: #0f766e; color: #fff; }
.task-assign-cancel { border-color: #777; color: #555; }
.task-assign-cancel:hover { background: #555; color: #fff; }
.task-metrics-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.task-metrics-head div { display: flex; flex-direction: column; gap: 2px; }
.task-metrics-head span { color: #666; font-size: 12px; }
.task-metrics-close { padding: 4px 10px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; cursor: pointer; }
.task-metrics-close:hover { border-color: #444; color: #111; }
.task-metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.task-score-block { margin-top: 12px; border: 1px solid #e2e6ed; border-radius: 6px; overflow: hidden; background: #fff; }
.task-score-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #f7f9fc; border-bottom: 1px solid #e2e6ed; font-weight: 700; }
.task-score-title span { color: #667085; font-size: 12px; font-weight: 500; }
.task-score-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.task-score-table th, .task-score-table td { padding: 7px 9px; border-bottom: 1px solid #edf0f5; text-align: left; white-space: nowrap; }
.task-score-table th { color: #667085; background: #fbfcfe; font-weight: 600; }
.task-score-table tfoot td { background: #fafafa; font-weight: 700; border-bottom: 0; }
.score-diff { display: inline-block; min-width: 34px; padding: 1px 6px; border-radius: 999px; text-align: center; font-family: ui-monospace, monospace; font-weight: 700; }
.score-diff.ok { background: #e8f5e9; color: #2e7d32; }
.score-diff.positive { background: #fff4e5; color: #b45309; }
.score-diff.negative { background: #fdecec; color: #b42318; }
.score-diff.unknown { background: #eef0f5; color: #667085; }
.ann-eval-report .task-score-block { flex-basis: 100%; margin-top: 4px; }
.task-metric-item { border: 1px solid #eef0f4; border-radius: 6px; padding: 8px; background: #fafbfc; display: flex; flex-direction: column; gap: 4px; min-height: 58px; }
.task-metric-item span { color: #666; font-size: 12px; }
.task-metric-item b { color: #222; font-size: 14px; line-height: 1.3; word-break: break-word; }
.stats-summary { margin-bottom: 10px; color: #555; font-size: 13px; }
.stats-panel { overflow-x: auto; }
.stats-table { min-width: 1600px; }
.stats-table td, .stats-table th { white-space: nowrap; }
.user-create-panel { display: flex; justify-content: flex-start; align-items: center; background: #fff; border: 1px solid #dfe3ea; border-radius: 8px; padding: 12px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.user-create-btn, .user-edit-btn, .user-reset-btn, .user-modal-save, .user-modal-cancel { padding: 4px 10px; border: 1px solid #1f6feb; border-radius: 4px; background: #fff; color: #1f6feb; cursor: pointer; font-weight: 600; }
.user-create-btn:hover, .user-edit-btn:hover, .user-modal-save:hover { background: #1f6feb; color: #fff; }
.user-actions { white-space: nowrap; }
.user-reset-btn { border-color: #777; color: #555; margin-left: 4px; }
.user-reset-btn:hover, .user-modal-cancel:hover { background: #555; border-color: #555; color: #fff; }
.user-modal-backdrop { position: fixed; inset: 0; z-index: 110; display: flex; align-items: flex-start; justify-content: center; padding: 92px 16px 24px; background: rgba(20, 24, 31, .32); }
.user-modal-panel { width: min(520px, 100%); max-height: calc(100vh - 128px); overflow: auto; border: 1px solid #dfe3ea; border-radius: 8px; background: #fff; box-shadow: 0 18px 48px rgba(0,0,0,.18); padding: 14px; }
.user-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-modal-head b { font-size: 15px; }
.user-modal-close { width: 28px; height: 28px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; cursor: pointer; }
.user-modal-close:hover { border-color: #1f6feb; color: #1f6feb; }
.user-modal-form { display: flex; flex-direction: column; gap: 12px; }
.user-modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.user-modal-grid label { display: flex; flex-direction: column; gap: 5px; color: #555; font-size: 12px; }
.user-modal-grid input, .user-modal-grid select { width: 100%; min-height: 32px; padding: 5px 7px; border: 1px solid #d0d0d6; border-radius: 4px; background: #fff; font-size: 13px; }
.user-modal-grid input:disabled, .user-modal-grid select:disabled { color: #777; background: #f1f3f5; }
.user-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
@media (max-width: 640px) { .user-modal-grid { grid-template-columns: 1fr; } }

/* ===== Annotator Mode ===== */
#btn-back-viewer { font-weight: 600; }
#btn-ann-reset { background: #f5f5f7; border-color: #d0d0d6; font-weight: 600; }
#btn-ann-reset:hover { background: #fde0e0; border-color: #c33; }
#btn-ann-export { background: #f5f5f7; border-color: #d0d0d6; font-weight: 600; }

/* Cluster cards */
.ann-cluster-card { background: #fff; border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.ann-cluster-card.unassigned { border: 1px solid #f0b35a; background: #fffaf2; }
.ann-cluster-card.unassigned .ann-cid { color: #b36200; }
.ann-eval-report { background: #fff; border: 1px solid #dfe3ea; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.ann-eval-title { font-weight: 700; color: #1f1f2e; margin-right: 4px; }
.ann-eval-item { color: #555; white-space: nowrap; }
.ann-eval-item b { color: #111; }
.ann-work-summary { background: #fff; border: 1px solid #dfe3ea; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.04); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.ann-work-summary.warn { background: #fffaf2; border-color: #f0c36d; }
.ann-work-summary.ok { background: #f3fbf6; border-color: #b8dfc8; }
.ann-work-title { font-weight: 700; color: #1f1f2e; }
.ann-work-summary b { color: #111; }
.ann-work-state { margin-left: auto; font-weight: 700; color: #475467; }
.ann-cluster-control { background:#fff; border-radius:8px; padding:10px 12px; margin-bottom:14px; display:flex; align-items:center; gap:10px; box-shadow:0 1px 3px rgba(0,0,0,.06); font-size:13px; }
.ann-cluster-control.empty { min-height:120px; justify-content:center; }
.ann-cluster-control input { width:72px; padding:4px 6px; border:1px solid #d0d0d6; border-radius:4px; font-size:13px; }
.ann-cluster-control button { padding:5px 12px; border:1px solid #1f6feb; background:#1f6feb; color:#fff; border-radius:4px; cursor:pointer; font-weight:600; }
.ann-readonly-note { color:#888; }
.ann-cluster-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.ann-select-all { display: flex; align-items: center; cursor: pointer; }
.ann-select-all input { accent-color: #1f6feb; }
.ann-cid { font-weight: 700; font-size: 16px; }
.ann-label { font-size: 13px; color: #333; padding: 2px 4px; border-radius: 4px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 3px; align-items: center; }
.cl-jersey { background: #e3f2fd; color: #1565c0; padding: 1px 5px; border-radius: 3px; font-weight: 600; white-space: nowrap; }
.cl-memo { background: #fce4ec; color: #c62828; padding: 1px 5px; border-radius: 3px; font-weight: 700; white-space: nowrap; }
.cl-memo-strong { font-weight: 800; }
.cl-team { background: #e8f5e9; color: #2e7d32; padding: 1px 5px; border-radius: 3px; font-weight: 700; white-space: nowrap; }
.cl-team-missing { background: #fde0e0; color: #c62828; }
.cl-nav-rest { color: #666; }
.cl-features { background: #f0f0f5; color: #333; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.cl-sep { color: #ccc; padding: 0 1px; }
.ann-consensus { font-size: 12px; color: #666; }
.ann-role-toggle { font-size: 11px; padding: 3px 8px; border: 1px solid #b7c2d0; border-radius: 4px; background: #f8fafc; color: #344054; cursor: pointer; font-weight: 600; }
.ann-role-toggle:hover { border-color: #1f6feb; color: #1f6feb; background: #f3f7ff; }
.ann-role-toggle.active { border-color: #1f6feb; background: #eaf2ff; color: #174ea6; }
.ann-merge-sel { font-size: 11px; padding: 2px 4px; border: 1px solid #d0d0d6; border-radius: 3px; }
.ann-team-sel { font-size: 11px; padding: 2px 4px; border: 1px solid #d0d0d6; border-radius: 3px; background: #fff; max-width: 140px; }
.ann-team-sel.missing { border-color: #c62828; background: #fff4f4; color: #9f1d1d; font-weight: 700; }
.ann-team-empty { font-size: 11px; padding: 2px 6px; border-radius: 3px; background: #fde0e0; color: #c62828; font-weight: 700; }

/* Event list */
.ann-cluster-group-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:14px 0 6px; padding:7px 10px; border:1px solid #dfe3ea; border-radius:6px; background:#f7f9fc; color:#263238; font-weight:700; flex-wrap: wrap; }
.ann-cluster-group-title em { font-style:normal; color:#667085; font-size:12px; font-weight:500; }
.ann-cluster-group-title small { color:#8a5a00; font-size:11px; font-weight:500; }
.ann-cluster-group-title.missing-team { background:#fff8e8; border-color:#f0c36d; }
.ann-cluster-group-title.unassigned { background:#fff4e8; border-color:#f0b35a; }
.ann-event-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 8px; }
.ann-event-role-title { grid-column: 1 / -1; display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:4px; padding:4px 8px; border-left:3px solid #9aa8b8; background:#f5f7fa; color:#344054; font-size:12px; font-weight:700; }
.ann-event-role-title:first-child { margin-top:0; }
.ann-event-role-title em { font-style:normal; color:#667085; font-weight:500; }
.ann-event-role-title.assist { border-left-color:#1976d2; background:#eef6ff; }
.ann-event-role-title.rebound { border-left-color:#7b4cc2; background:#f5f1ff; }
.ann-ev-card { display: flex; gap: 8px; border: 1px solid #eee; border-radius: 8px; padding: 6px; background: #fafafc; transition: border-color 0.2s; position: relative; }
.ann-ev-card:hover { border-color: #1f6feb; background: #fff; }
.ann-ev-card:has(.ann-ev-check input:checked) { border-color: #1f6feb; background: #f0f5ff; }
.ann-ev-card.mismatch { border-color: #e67e22; background: #fff8f0; }
.ann-ev-card.pending { border-color: #8e44ad; background: #f5f0f8; }
.ann-ev-card.confirmed { border-color: #27ae60; background: #eafaf1; }
.ann-ev-card.unassigned-event { border-style: dashed; }
.ann-ev-card.needs-review { border-color: #d93025; background: #fff4f4; box-shadow: 0 0 0 1px rgba(217,48,37,.08) inset; }
.ann-ev-card.discarded-no-game { border-color: #8a949e; background: #f1f3f5; box-shadow: 4px 0 0 #c62828 inset; }
.ann-ev-card.discarded-no-game:hover { border-color: #c62828; background: #eef0f3; }
.ann-ev-card.discarded-no-game .ann-ev-info::after { content: "已标为非比赛中"; display: inline-flex; width: fit-content; padding: 2px 6px; border-radius: 3px; background: #c62828; color: #fff; font-size: 10px; font-weight: 700; }
.ann-ev-card.last-event { border-bottom: 3px solid #1f6feb; }

/* Annotation tags */
.anno-tags { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0; }
.anno-tag { font-size: 10px; padding: 2px 5px; border-radius: 3px; cursor: pointer; background: #eee; color: #555; border: 1px solid #ddd; user-select: none; line-height: 1.4; text-align: center; white-space: nowrap; }
.anno-tag:hover { background: #dde; }
.anno-tag.anno-ok { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.anno-tag.anno-err { background: #fde0e0; color: #c62828; border-color: #ef9a9a; }
.anno-tag.anno-no-game { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.anno-tag.anno-3pt { background: #c5cae9; color: #1a237e; border-color: #7986cb; }
.anno-tag.anno-ft { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.ann-shoot-type-select { font-size: 10px; border: 0; background: transparent; color: inherit; padding: 0; outline: none; cursor: pointer; }

/* Action buttons */
.ann-ev-actions { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; align-items: flex-start; }
.ann-ev-actions select { font-size: 10px; padding: 1px 2px; border: 1px solid #ddd; border-radius: 3px; opacity: 0.6; width: 32px; }
.ann-ev-card:hover .ann-ev-actions select { opacity: 1; }
.ann-pending-btn, .ann-confirm-btn, .ann-discard-btn { font-size: 13px; padding: 1px 0; border: 1px solid #ccc; border-radius: 3px; background: #fff; cursor: pointer; color: #888; text-align: center; line-height: 1.3; width: 26px; }
.ann-pending-btn:hover { border-color: #8e44ad; color: #8e44ad; }
.ann-pending-btn.active { background: #8e44ad; color: #fff; border-color: #8e44ad; }
.ann-confirm-btn:hover { border-color: #27ae60; color: #27ae60; }
.ann-confirm-btn.active { background: #27ae60; color: #fff; border-color: #27ae60; }
.ann-discard-btn:hover { border-color: #c62828; color: #c62828; }
.ann-discard-btn.active { background: #c62828; color: #fff; border-color: #c62828; }
.ann-pending-btn:hover { border-color: #8e44ad; color: #8e44ad; }
.ann-pending-btn.active { background: #8e44ad; color: #fff; border-color: #8e44ad; }
.ann-confirm-btn:hover { border-color: #27ae60; color: #27ae60; }
.ann-confirm-btn.active { background: #27ae60; color: #fff; border-color: #27ae60; }

/* Checkbox */
.ann-ev-check { display: flex; align-items: flex-start; padding-top: 4px; cursor: pointer; flex-shrink: 0; }
.ann-ev-check input { accent-color: #1f6feb; width: 16px; height: 16px; }

/* Frame carousel */
.ann-ev-visual { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ann-frame-carousel { position: relative; cursor: pointer; width: 140px; height: 140px; overflow: hidden; border-radius: 6px; background: #e8e8ec; }
.ann-frame-carousel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-frame-preview { background: #dfe4ec; }
.ann-frame-preview-large { background: #eef4ff; }
.ann-frame-preview-clip { background: #000; }
.ann-frame-play { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:28px; line-height:1; background:linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.38)); }
.ann-frame-preview-clip:hover .ann-frame-play { background:rgba(31,111,235,.72); }
.ann-frame-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.ann-frame-fallback-label { position: absolute; left: 4px; top: 4px; z-index: 2; font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 3px; background: rgba(0,0,0,.55); color: #fff; pointer-events: none; }
.ann-frame-preview-large .ann-frame-fallback-label { background: rgba(31,111,235,.82); }
.ann-frame-preview-clip .ann-frame-fallback-label { background: rgba(0,0,0,.72); }
.ann-frame-preview-empty { display: flex; align-items: center; justify-content: center; color: #888; font-size: 12px; }
.carousel-counter { position: absolute; bottom: 3px; right: 3px; font-size: 10px; padding: 1px 4px; background: rgba(0,0,0,.55); color: #fff; border-radius: 2px; font-family: ui-monospace, monospace; }
.ann-video-link { font-size: 10px; color: #1f6feb; text-decoration: none; padding: 2px 6px; border: 1px solid #1f6feb; border-radius: 3px; line-height: 1; background:#fff; cursor:pointer; }
.ann-video-link:hover { background: #1f6feb; color: #fff; }
.ann-ev-btns { display: flex; gap: 3px; align-items: center; margin-top: 3px; }

/* Event info */
.ann-ev-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; }
.ann-ev-info .ann-ev-id { font-weight: 600; font-size: 13px; font-family: ui-monospace, monospace; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-ev-jersey { display: inline-block; padding: 1px 6px; border-radius: 3px; font-family: ui-monospace, monospace; font-size: 11px; width: fit-content; }
.ann-ev-jersey.jersey-ok { background: #e8f5e9; color: #2e7d32; }
.ann-ev-jersey.jersey-warn { background: #fde0e0; color: #c62828; font-weight: 600; }
.ann-review-badge { display: inline-flex; align-items: center; width: fit-content; padding: 2px 6px; border-radius: 999px; font-size: 10px; line-height: 1.4; font-weight: 700; letter-spacing: 0; }
.ann-review-badge.urgent { background: #d93025; color: #fff; }
.ann-review-badge.muted { background: #eef0f5; color: #555; }
.ann-gt-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-family: ui-monospace, monospace; color: #fff; width: fit-content; }
.ann-gt-badge.gt-ok { background: #2a8; }
.ann-gt-badge.gt-err { background: #c33; }

/* Cluster nav */
.ann-nav-group { margin: 8px 0 4px; padding: 4px 6px; border-radius: 4px; background: #eef2f7; color: #333; font-size: 12px; font-weight: 700; }
.ann-nav-group span { color: #667085; font-weight: 500; margin-left: 4px; }
.ann-nav-group.missing-team { background: #fff8e8; color: #8a5a00; }
.ann-nav-group.unassigned { background: #fff4e8; color: #a15c00; }
.ann-nav-item { cursor: pointer; padding: 5px 6px; margin: 2px 0; border-radius: 4px; background: #f5f5f7; border: 1px solid transparent; }
.ann-nav-item:hover { background: #eef4ff; border-color: #cfd9ee; }
.ann-nav-item.unassigned { background: #fff4e8; border-color: #f0b35a; }
.ann-nav-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ann-nav-count { color: #888; }
.ann-nav-meta { font-size: 10px; color: #666; margin-top: 2px; line-height: 1.35; }
.ann-nav-badge { font-size: 10px; padding: 1px 5px; border-radius: 999px; font-weight: 700; line-height: 1.4; }
.ann-nav-badge.urgent { background: #d93025; color: #fff; }

.ann-ev-card:hover .ann-ev-actions select { opacity: 1; }

/* Floating action bar */
.ann-action-bar { position: sticky; bottom: 0; background: #1f1f2e; color: #fff; padding: 10px 16px; border-radius: 8px 8px 0 0; display: flex; align-items: center; gap: 12px; font-size: 13px; z-index: 5; margin-top: 8px; }
.ann-action-bar select { padding: 4px 8px; border-radius: 4px; border: none; font-size: 13px; }
.ann-action-btn { padding: 5px 14px; background: #1f6feb; color: #fff; border: none; border-radius: 4px; font-weight: 600; cursor: pointer; }
.ann-action-btn:hover { background: #155bcb; }
.ann-action-clear { padding: 5px 10px; background: transparent; color: #aaa; border: 1px solid #666; border-radius: 4px; cursor: pointer; }
.ann-action-clear:hover { color: #fff; border-color: #fff; }

/* Full-size overlay */
.ann-fullsize-btn { font-size:14px; cursor:pointer; padding:1px 4px; border:1px solid #ddd; border-radius:3px; background:#fff; line-height:1.2; }
.ann-fullsize-btn:hover { background:#1f6feb; }
.ann-fullsize-overlay { position:fixed; inset:0; z-index:220; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(0,0,0,.45); }
.ann-fullsize-panel { position:relative; max-width:90vw; max-height:90vh; background:#000; border-radius:8px; overflow:hidden; box-shadow:0 8px 32px rgba(0,0,0,.5); }
.ann-fullsize-panel img { display:block; max-width:90vw; max-height:85vh; object-fit:contain; }
.ann-fullsize-ctr { position:absolute; bottom:6px; right:8px; font-size:11px; color:#fff; background:rgba(0,0,0,.6); padding:2px 6px; border-radius:2px; font-family:monospace; }
.ann-fullsize-close { position:absolute; top:6px; right:6px; z-index:2; width:28px; height:28px; border-radius:50%; border:1px solid rgba(255,255,255,.35); background:rgba(0,0,0,.65); color:#fff; font-size:20px; line-height:24px; cursor:pointer; }
.ann-fullsize-close:hover { background:rgba(31,111,235,.9); }
.ann-video-overlay { position: fixed; inset: 0; z-index: 230; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 24px; }
.ann-video-panel { position: relative; background: #050505; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.5); overflow: hidden; max-width: min(900px, 92vw); max-height: 86vh; }
.ann-video-loading { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; background:#050505; font-size:14px; z-index:1; }
.ann-video-loading[hidden] { display:none; }
.ann-video-player { display: block; width: min(900px, 92vw); max-height: 86vh; background: #000; }
.ann-video-close { position: absolute; top: 6px; right: 6px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.65); color: #fff; font-size: 20px; line-height: 24px; cursor: pointer; }
.ann-video-close:hover { background: rgba(31,111,235,.9); }

/* Feature profiles & mismatches */
.ann-feat-profile { font-size: 11px; color: #555; background: #f0f5ff; padding: 1px 6px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }
.ann-feat-mismatches { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px; }
.feat-mismatch { font-size: 10px; padding: 1px 4px; background: #fff3e0; color: #e65100; border-radius: 2px; border: 1px solid #ffe0b2; white-space: nowrap; font-family: ui-monospace, monospace; }
.ann-ev-card:has(.ann-feat-mismatches) { border-color: #ff9800; background: #fff8e8; }
