* { 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 #ann-filter-shoot-type,
.ctrls #ann-filter-is-goal,
.ctrls #ann-filter-in-game,
.ctrls #ann-filter-event-valid { min-width: 96px; }
.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 { border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; font-size: 14px; }
.ann-work-summary.warn { background: #fff5f0; border: 2px solid #f8712c; }
.ann-work-summary.warn .ann-work-head { color: #d9440b; }
.ann-work-summary.ok { background: #e9fbf0; border: 2px solid #2ba35e; }
.ann-work-summary.ok .ann-work-head { color: #1e7a41; }
.ann-work-head { font-size: 16px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ann-work-head .ann-work-icon { font-size: 20px; }
.ann-work-items { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ann-work-items .item { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; font-size: 13px; }
.ann-work-summary.warn .ann-work-items .item { background: rgba(248,113,44,.12); color: #b8450e; }
.ann-work-summary.warn .ann-work-items .item b { color: #d9440b; }
.ann-work-summary.ok .ann-work-items .item { background: rgba(43,163,94,.12); color: #1e7a41; }
.ann-work-items .item.zero { opacity: .4; text-decoration: line-through; }
.ann-work-state-msg { margin-top: 10px; padding: 8px 14px; border-radius: 6px; font-weight: 700; font-size: 14px; text-align: center; }
.ann-work-summary.warn .ann-work-state-msg { background: #fde2d4; color: #b8450e; border: 1px solid #f8b694; }
.ann-work-summary.ok .ann-work-state-msg { background: #c8f0d8; color: #1e7a41; border: 1px solid #8ed4a8; }
.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-match-info-banner { background: linear-gradient(135deg, #edf4ff 0%, #e8f0fe 100%); border: 1px solid #b8d4fe; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; color: #1a56db; text-align: center; }
.ann-match-info-banner b { color: #0b3d91; }
.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-team.custom {
  background: color-mix(in srgb, var(--team-color) 18%, white);
  color: color-mix(in srgb, var(--team-color) 72%, black);
  border: 1px solid color-mix(in srgb, var(--team-color) 42%, white);
}
.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-delete-cluster-btn { font-size: 11px; padding: 2px 8px; border: 1px solid #e0c0c0; border-radius: 3px; background: #fff; color: #c62828; cursor: pointer; white-space: nowrap; }
.ann-delete-cluster-btn:hover { background: #fde8e8; border-color: #c62828; }
.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-empty-role-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px dashed #c7d0dd;
  border-radius: 8px;
  background: #f8fafc;
  color: #52606d;
  font-size: 12px;
  line-height: 1.5;
}
.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, opacity 0.25s, box-shadow 0.2s; position: relative; }
.ann-ev-card:hover { border-color: #1f6feb; background: #fff; box-shadow: 0 1px 4px rgba(31,111,235,.1); }
.ann-ev-card:has(.ann-ev-check input:checked) { border-color: #1f6feb; background: #f0f5ff; box-shadow: 0 0 0 2px rgba(31,111,235,.15); }
.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; opacity: 0.6; }
.ann-ev-card.confirmed:hover { opacity: 1; }
.ann-ev-card.unassigned-event { border-style: dashed; border-width: 2px; border-color: #f0b35a; background: #fffaf3; }
.ann-ev-card.needs-review { border-color: #d93025; border-width: 2px; background: #fff4f4; box-shadow: 0 0 0 2px rgba(217,48,37,.12); }
.ann-ev-card.non-game-event { border-color: #f59e0b; background: #fff7ed; opacity: 0.76; box-shadow: 4px 0 0 #f59e0b inset; }
.ann-ev-card.non-game-event:hover { opacity: 0.92; border-color: #d97706; background: #ffedd5; }
.ann-ev-card.non-game-event .ann-ev-info::after { content: "非比赛中"; display: inline-flex; width: fit-content; padding: 2px 6px; border-radius: 3px; background: #f59e0b; color: #7c2d12; font-size: 10px; font-weight: 700; }
.ann-ev-card.discarded-event { border-color: #b91c1c; background: #fff1f2; opacity: 0.72; box-shadow: 4px 0 0 #b91c1c inset; }
.ann-ev-card.discarded-event:hover { opacity: 0.9; border-color: #b91c1c; background: #ffe4e6; }
.ann-ev-card.discarded-event .ann-ev-info::after { content: "已废弃：不计技术统计"; display: inline-flex; width: fit-content; padding: 2px 6px; border-radius: 3px; background: #b91c1c; 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: 34px; }
.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; overflow: hidden; }
.ann-frame-carousel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-frame-preview-crop img { object-fit: contain; background: #f3f6fb; }
.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; white-space: nowrap; }
.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; }

/* Teams in task list */
.task-team-item { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.match-color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); flex-shrink: 0; }

/* ===== Annotator Workbench Redesign ===== */
:root {
  --ann-bg: #f3f5f8;
  --ann-panel: #ffffff;
  --ann-panel-muted: #f8fafc;
  --ann-border: #dce3ec;
  --ann-border-strong: #c9d5e3;
  --ann-text: #152033;
  --ann-text-muted: #5d6b82;
  --ann-primary: #1f6feb;
  --ann-primary-soft: #ebf2ff;
  --ann-warn: #c86a18;
  --ann-warn-soft: #fff3e6;
  --ann-danger: #c53b24;
  --ann-danger-soft: #fff1ec;
  --ann-success: #1f8b4c;
  --ann-success-soft: #e9f8ef;
  --ann-shadow: 0 10px 26px rgba(16, 24, 40, .08);
}

body { background: var(--ann-bg); color: var(--ann-text); }
#annotator-page main { padding: 18px 18px 72px; }
.ann-nav-panel {
  position: fixed;
  left: 0;
  top: 112px;
  bottom: 0;
  width: 280px;
  padding: 14px 12px;
  background: rgba(248, 250, 252, .98);
  border-right: 1px solid var(--ann-border);
  box-shadow: 8px 0 24px rgba(15, 23, 42, .08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.ann-nav-panel[hidden] { display: none; }
.ann-nav-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ann-nav-head strong { display: block; font-size: 15px; }
.ann-nav-head small { display: block; margin-top: 4px; color: var(--ann-text-muted); line-height: 1.4; }
.ann-nav-close {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--ann-border);
  background: #fff; color: var(--ann-text-muted); cursor: pointer; font-size: 18px; line-height: 1;
}
.ann-nav-close:hover { border-color: var(--ann-primary); color: var(--ann-primary); }
.ann-nav-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ann-nav-filters button {
  border: 1px solid var(--ann-border); background: #fff; color: var(--ann-text-muted);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.ann-nav-filters button.active { background: var(--ann-primary); border-color: var(--ann-primary); color: #fff; }
.ann-nav-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 2px; padding-bottom: 18px; }
.ann-nav-empty { padding: 18px 12px; border: 1px dashed var(--ann-border-strong); border-radius: 8px; color: var(--ann-text-muted); background: #fff; }

.ann-workbench-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 18px 20px; margin-bottom: 14px; border: 1px solid var(--ann-border);
  border-radius: 10px; background: linear-gradient(180deg, #ffffff, #fbfdff); box-shadow: var(--ann-shadow);
}
.ann-workbench-title .eyebrow { display: inline-block; margin-bottom: 6px; font-size: 12px; color: var(--ann-text-muted); font-weight: 700; }
.ann-workbench-title h2 { margin: 0; font-size: 24px; line-height: 1.2; }
.ann-workbench-title p { margin: 6px 0 0; color: var(--ann-text-muted); font-size: 14px; }
.ann-workbench-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ann-head-chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--ann-border); background: #fff; color: var(--ann-text-muted); font-size: 12px; font-weight: 700;
}
.ann-head-chip-info {
  border-color: #b8d4fe; background: #edf4ff; color: #1a56db;
}

.ann-summary-strip {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(400px, 1.3fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}
.ann-summary-card { border: 1px solid var(--ann-border); border-radius: 10px; background: var(--ann-panel); box-shadow: var(--ann-shadow); height: 100%; }
.ann-summary-card > * { height: 100%; }
.ann-summary-card-wide .task-score-block { margin-top: 0; border: 0; border-radius: 10px; overflow: hidden; }
.ann-summary-card-wide .task-score-title { padding: 12px 14px; background: #f7faff; }
.ann-live-score-panel { display: flex; }
.ann-live-score-panel .task-score-block { display: flex; flex-direction: column; width: 100%; }
.ann-live-score-panel .task-score-table { height: 100%; }
.ann-live-score-panel .task-score-table th,
.ann-live-score-panel .task-score-table td { vertical-align: middle; }

.ann-work-summary { padding: 14px; }
.ann-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-height: 100%; }
.ann-summary-metric {
  padding: 14px; border-radius: 10px; border: 1px solid var(--ann-border);
  background: var(--ann-panel-muted); min-height: 112px; display: flex; flex-direction: column; justify-content: space-between;
}
.ann-summary-metric.zero { opacity: .72; }
.ann-summary-metric.ok { background: var(--ann-success-soft); border-color: #b7e2c7; }
.ann-summary-metric.warn { background: var(--ann-warn-soft); border-color: #f2d19b; }
.ann-summary-metric.danger { background: var(--ann-danger-soft); border-color: #f2bdb0; }
.ann-summary-state.ok { background: var(--ann-success-soft); }
.ann-summary-state.warn { background: var(--ann-danger-soft); }
.ann-summary-label { font-size: 13px; color: var(--ann-text-muted); font-weight: 700; }
.ann-summary-value { font-size: 28px; line-height: 1; }
.ann-summary-state .ann-summary-value { font-size: 22px; }
.ann-summary-state small { color: var(--ann-text-muted); line-height: 1.45; font-size: 13px; }

.ann-cluster-stage { display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; }
.ann-stage-toolbar .ann-cluster-control {
  margin-bottom: 0; border: 1px solid var(--ann-border); border-radius: 10px; box-shadow: var(--ann-shadow);
  padding: 12px 14px; background: var(--ann-panel);
}
.ann-cluster-stack { display: flex; flex-direction: column; gap: 16px; padding-bottom: 20px; }

.ann-cluster-card {
  margin-bottom: 0; border: 1px solid var(--ann-border); border-radius: 10px;
  background: var(--ann-panel); padding: 16px; box-shadow: var(--ann-shadow);
}
.ann-cluster-card.tone-light {
  background: #ffffff;
  box-shadow:
    0 10px 26px rgba(16, 24, 40, .08),
    inset 5px 0 0 #c8d9ee;
}
.ann-cluster-card.tone-muted {
  background: #e9eaeb;
  box-shadow:
    0 10px 26px rgba(16, 24, 40, .08),
    inset 5px 0 0 #8b8f94;
}
.ann-cluster-card.unassigned { border-color: #efc17a; background: linear-gradient(180deg, #fff8ef, #fffdf9); }
.ann-cluster-card.tone-light .ann-cluster-head {
  background: linear-gradient(180deg, rgba(240, 246, 253, .82), rgba(255, 255, 255, 0));
  margin: -16px -16px 14px;
  padding: 16px 16px 12px;
  border-radius: 10px 10px 0 0;
}
.ann-cluster-card.tone-muted .ann-cluster-head {
  background: linear-gradient(180deg, rgba(205, 207, 210, .98), rgba(233, 234, 235, 0));
  margin: -16px -16px 14px;
  padding: 16px 16px 12px;
  border-radius: 10px 10px 0 0;
}
.ann-cluster-card.tone-muted .ann-ev-card:not(.pending):not(.confirmed):not(.mismatch):not(.unassigned-event):not(.needs-review):not(.non-game-event):not(.discarded-event):not(:has(.ann-ev-check input:checked)) {
  background: #f2f3f4;
  border-color: #d8dade;
}
.ann-cluster-card.tone-muted .ann-event-role-title {
  background: #eef0f2;
  border-left-color: #8b8f94;
}
.ann-cluster-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #ebf0f6; }
.ann-cluster-head-main, .ann-cluster-head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-cluster-title-block { min-width: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ann-cluster-meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 30px; }
.ann-cid { font-size: 17px; }
.ann-label {
  padding: 4px 8px; border-radius: 999px; background: #f2f6fb; color: var(--ann-text);
  font-size: 12px; max-width: 100%; min-height: 28px; display: inline-flex; align-items: center;
}
.ann-consensus { color: var(--ann-text-muted); font-size: 12px; }
.ann-select-all { min-height: 34px; display: inline-flex; align-items: center; }
.ann-role-toggle {
  min-height: 34px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; padding: 0 10px; border: 1px solid #b7c2d0; border-radius: 8px;
  background: #f8fafc; color: #344054; cursor: pointer; font-weight: 600;
}
.ann-role-selects { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ann-role-select-btn {
  min-height: 34px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; padding: 0 10px; border: 1px solid #c8d2df; border-radius: 8px;
  background: #fff; color: #344054; cursor: pointer; font-weight: 700;
}
.ann-role-select-btn:hover { border-color: #1f6feb; color: #174ea6; background: #f3f7ff; }
.ann-role-select-btn.active {
  border-color: #1f6feb; background: #eaf2ff; color: #174ea6;
  box-shadow: inset 0 0 0 1px rgba(31,111,235,.12);
}
.ann-collapse-toggle {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--ann-border-strong); background: #fff;
  color: var(--ann-text-muted); cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0;
}
.ann-collapse-toggle:hover { border-color: var(--ann-primary); color: var(--ann-primary); background: var(--ann-primary-soft); }
.ann-collapse-toggle.cluster { margin-left: auto; }
.ann-cluster-hint {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px;
  border-radius: 999px; background: var(--ann-warn-soft); color: #8b4a11; font-size: 12px; font-weight: 600;
}
.ann-cluster-head-tools { min-height: 34px; gap: 8px; }
.ann-cluster-head-tools .ann-head-input {
  padding: 4px 8px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 12px;
  transition: border-color 0.15s, box-shadow 0.15s; background: #fff;
}
.ann-cluster-head-tools .ann-head-input:focus {
  border-color: #1f6feb; box-shadow: 0 0 0 2px rgba(31,111,235,.15); outline: none;
}
.ann-cluster-head-tools .ann-head-input-jersey { width: 64px; text-align: center; font-family: ui-monospace, monospace; }
.ann-cluster-head-tools .ann-head-input-memo { min-width: 120px; flex: 1; }
.ann-head-input {
  height: 34px; border: 1px solid var(--ann-border-strong); border-radius: 8px;
  background: #fff; padding: 0 8px; font-size: 12px;
}
.ann-head-input-jersey { width: 58px; }
.ann-head-input-memo { width: 128px; }
.ann-merge-sel, .ann-team-sel {
  height: 34px; border-radius: 8px; border: 1px solid var(--ann-border-strong); background: #fff;
  padding: 0 8px; font-size: 11px;
}

.ann-cluster-group-title {
  margin: 10px 0 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ann-border);
  background: #f8fafc;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}
.ann-group-title-main, .ann-group-title-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-cluster-group-title span:first-of-type { font-size: 14px; }
.ann-cluster-group-title em { background: rgba(255,255,255,.72); padding: 2px 8px; border-radius: 999px; }
.ann-cluster-group-title.unassigned { background: var(--ann-warn-soft); border-color: #efc17a; }
.ann-cluster-group-title.missing-team { background: #fff6e8; border-color: #f0c36d; }
.ann-cluster-collapsed-note {
  padding: 10px 12px; border-radius: 8px; background: #f8fafc; border: 1px dashed var(--ann-border-strong);
  color: var(--ann-text-muted); font-size: 12px;
}

.ann-event-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.ann-ev-card {
  display: flex;
  gap: 10px; padding: 8px; border: 1px solid var(--ann-border); border-radius: 10px;
  background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color 0.2s, opacity 0.25s, box-shadow 0.2s;
}
.ann-ev-card:hover { border-color: var(--ann-primary); box-shadow: 0 6px 16px rgba(31, 111, 235, .08); }
.ann-ev-card:has(.ann-ev-check input:checked) { background: #f3f7ff; box-shadow: 0 0 0 2px rgba(31,111,235,.15); }
.ann-ev-card.confirmed { opacity: 0.55; border-color: #27ae60; background: #eafaf1; }
.ann-ev-card.confirmed:hover { opacity: 1; }
.ann-ev-card.pending { border-color: #8e44ad; background: #f5f0f8; }
.ann-ev-card.unassigned-event { border-style: dashed; border-width: 2px; border-color: #f0b35a; background: #fffaf3; }
.ann-ev-card.needs-review { border-color: #d93025; border-width: 2px; background: #fff4f4; box-shadow: 0 0 0 2px rgba(217,48,37,.12); }
.ann-ev-card.non-game-event { opacity: 0.76; border-color: #f59e0b; background: #fff7ed; box-shadow: 4px 0 0 #f59e0b inset; }
.ann-ev-card.non-game-event:hover { opacity: 0.92; }
.ann-ev-card.discarded-event { opacity: 0.72; border-color: #b91c1c; background: #fff1f2; box-shadow: 4px 0 0 #b91c1c inset; }
.ann-ev-card.discarded-event:hover { opacity: 0.9; }
.ann-ev-card.last-event { border-bottom: 3px solid var(--ann-primary); }
.ann-ev-visual { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ann-frame-carousel { width: 140px; height: 140px; border-radius: 8px; border: 1px solid var(--ann-border); background: #eaf0f6; }
.ann-frame-preview-large { background: #eef4ff; }
.ann-ev-btns { width: 100%; justify-content: flex-start; }
.ann-ev-info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12px; }
.ann-ev-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; min-height: 22px; }
.ann-ev-id {
  font-size: 13px; font-weight: 600; font-family: ui-monospace, monospace;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ann-review-badge.urgent { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ann-ev-actions { display: flex; flex-direction: column; gap: 6px; justify-content: flex-start; align-items: flex-start; flex-shrink: 0; }
.ann-pending-btn, .ann-confirm-btn, .ann-discard-btn {
  width: 44px; min-height: 30px; border-radius: 6px; font-size: 13px; font-weight: 700;
  border: 1px solid #ccc; background: #fff; cursor: pointer; color: #888; text-align: center; line-height: 1.3; padding: 1px 0;
}
.ann-ev-actions select { width: 48px; min-height: 30px; border-radius: 6px; }

.ann-nav-group {
  margin: 10px 0 6px; padding: 6px 8px; border-radius: 8px; background: #edf2f7; color: var(--ann-text);
}
.ann-nav-item {
  margin: 0 0 6px; padding: 8px; border-radius: 8px; background: #fff; border: 1px solid var(--ann-border);
}
.ann-nav-item.unassigned { background: #fff8ef; border-color: #efc17a; }
.ann-nav-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.ann-nav-count { color: var(--ann-text-muted); }
.ann-nav-meta { color: var(--ann-text-muted); line-height: 1.45; }
.ann-nav-badge { background: #eef4ff; color: #174ea6; }

.ann-action-bar {
  display: flex;
  position: sticky; bottom: 0; margin-top: 0; border-radius: 10px 10px 0 0; padding: 14px 16px;
  background: rgba(18, 24, 38, .96); box-shadow: 0 -8px 20px rgba(15, 23, 42, .16);
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.ann-action-meta { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.ann-action-kicker { color: #9fb4d8; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.ann-action-meta small { color: #b7c2d6; line-height: 1.4; }
.ann-action-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-action-bar select {
  min-width: 280px; height: 36px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.92);
}
.ann-action-btn, .ann-action-clear {
  min-height: 36px; padding: 0 14px; border-radius: 8px;
}
.ann-action-btn {
  background: #1f6feb; color: #fff; border: none; font-weight: 600; cursor: pointer;
}
.ann-action-btn.confirm { background: #27ae60; }
.ann-action-btn.confirm:hover { background: #219a52; }
.ann-action-btn.pending { background: #8e44ad; }
.ann-action-btn.pending:hover { background: #7b3a96; }
.ann-action-clear {
  background: transparent; color: #aaa; border: 1px solid #666; cursor: pointer;
}
.ann-action-btn:disabled, .ann-action-clear:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 1200px) {
  .ann-summary-strip { grid-template-columns: 1fr; }
  .ann-nav-panel { width: 250px; }
  .ann-event-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

@media (max-width: 900px) {
  .ann-workbench-head { flex-direction: column; }
  .ann-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ann-event-list { grid-template-columns: 1fr; }
  .ann-frame-carousel { width: 136px; height: 136px; }
  .ann-action-bar { border-radius: 10px; }
  .ann-action-controls { width: 100%; }
  .ann-action-bar select { min-width: 0; flex: 1; }
  .ann-nav-panel { width: min(280px, 84vw); top: 0; z-index: 60; padding-top: 18px; }
}

@media (max-width: 720px) {
  #annotator-page main { padding: 12px 12px 72px; }
  .ann-summary-grid { grid-template-columns: 1fr; }
  .ann-cluster-head-main, .ann-cluster-head-tools { align-items: flex-start; }
  .ann-ev-card { flex-wrap: wrap; }
  .ann-ev-visual { width: 100%; align-items: flex-start; }
  .ann-frame-carousel { width: 122px; height: 122px; }
  .ann-group-title-main, .ann-group-title-side { width: 100%; }
}

/* ---- Custom confirm/prompt modal ---- */

/* ---- Save status indicator ---- */
.ann-save-status { font-size: 12px; padding: 2px 8px; border-radius: 4px; transition: opacity .3s, color .2s; white-space: nowrap; }
.ann-save-status.saving { color: #1f6feb; }
.ann-save-status.saved { color: #2e7d32; }
.ann-save-status.error { color: #c62828; }
.ann-save-status.fade-out { opacity: 0; }
.ptz-confirm-overlay { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18,24,38,.42); animation: ptz-confirm-in .12s ease-out; }
@keyframes ptz-confirm-in { from { opacity: 0; } to { opacity: 1; } }
.ptz-confirm-panel { width: min(420px, 90%); background: #fff; border-radius: 8px; padding: 20px 24px; box-shadow: 0 14px 40px rgba(0,0,0,.2); }
.ptz-confirm-msg { margin: 0 0 16px; font-size: 14px; line-height: 1.6; white-space: pre-line; color: #222; }
.ptz-confirm-input { width: 100%; padding: 8px 10px; border: 1px solid #cfd5df; border-radius: 4px; font-size: 14px; margin-bottom: 16px; }
.ptz-confirm-input:focus { outline: 2px solid rgba(31,111,235,.18); border-color: #1f6feb; }
.ptz-confirm-btns { display: flex; gap: 8px; justify-content: flex-end; }
.ptz-confirm-btns button { padding: 6px 16px; border-radius: 4px; border: 1px solid #d0d0d6; cursor: pointer; font-weight: 600; font-size: 13px; }
.ptz-confirm-ok { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.ptz-confirm-ok:hover { background: #155bcb; }
.ptz-confirm-ok.danger { background: #c62828; border-color: #c62828; }
.ptz-confirm-ok.danger:hover { background: #a31f1f; }
.ptz-confirm-cancel { background: #fff; color: #555; }
.ptz-confirm-cancel:hover { background: #f5f5f7; }

/* ---- Progress indicator (remaining work) ---- */
.ann-progress-ring {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border-radius: 8px; background: #fff8e8; border: 1px solid #f0c36d; font-size: 12px; color: #334155;
}
.ann-progress-ring.ok {
  background: #e8f5e9; border-color: #a5d6a7;
}
.ann-progress-ring.ok .ann-progress-ring-label { color: #2e7d32; font-weight: 700; }
.ann-progress-blocker {
  display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 4px;
  font-weight: 600; font-size: 11px; white-space: nowrap;
}
.ann-progress-blocker.warn { background: #fde0a0; color: #8a5a00; }
.ann-progress-blocker.pending { background: #e8d5f5; color: #6a1b9a; }
.ann-progress-sep { color: #ccc; padding: 0 1px; }
.ann-progress-ring-sub { color: #64748b; font-size: 11px; margin-left: 4px; }

/* ---- Toolbar dropdown ---- */
.ann-toolbar-group { position: relative; display: inline-flex; }
.ann-toolbar-trigger {
  font-size: 13px; padding: 4px 10px; border: 1px solid #d0d0d6; background: #fff;
  border-radius: 4px; cursor: pointer; color: #333; display: inline-flex; align-items: center; gap: 4px;
}
.ann-toolbar-trigger:hover { border-color: #1f6feb; color: #1f6feb; }
.ann-toolbar-trigger::after { content: '▾'; font-size: 10px; color: #888; }
.ann-toolbar-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 20;
  min-width: 140px; margin-top: 4px; padding: 4px 0;
  background: #fff; border: 1px solid #dfe3ea; border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.ann-toolbar-group.open .ann-toolbar-menu { display: block; }
.ann-toolbar-menu button {
  display: block; width: 100%; text-align: left; padding: 6px 12px;
  font-size: 13px; border: none; background: none; cursor: pointer; color: #333;
}
.ann-toolbar-menu button:hover { background: #f0f5ff; color: #1f6feb; }
.ann-toolbar-menu .sep { height: 1px; background: #eee; margin: 4px 0; }

/* ── Move target panel ── */
.ann-move-panel-overlay {
  position: fixed; inset: 0; z-index: 250;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(18, 24, 38, .42);
}
.ann-move-panel {
  width: min(860px, 96%);
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #dfe3ea; border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0,0,0,.18);
  overflow: hidden;
}
.ann-move-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #e8ecf1;
  font-size: 15px; color: #1e293b; flex-shrink: 0;
}
.ann-move-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: #94a3b8; padding: 2px 6px; border-radius: 4px;
}
.ann-move-close:hover { background: #f1f5f9; color: #334155; }
.ann-move-panel-body {
  overflow-y: auto; flex: 1; padding: 10px 12px 14px;
}
.ann-move-section + .ann-move-section { margin-top: 14px; }
.ann-move-section-head {
  margin-bottom: 8px; padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
  color: #0f172a; background: #eef2ff;
  border: 1px solid #c7d2fe; border-radius: 8px;
}
.ann-move-section-title {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
}
.ann-move-team-dot {
  display: inline-block; width: 12px; height: 12px; margin-left: 4px;
  border-radius: 999px; vertical-align: -2px; flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, .35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}
.ann-move-team-color-missing { color: #64748b; font-weight: 700; }
.ann-move-section-missing .ann-move-section-head {
  background: #f8fafc; border-color: #dbe3ee; color: #475569;
}
.ann-move-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ann-move-card {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px; cursor: pointer;
  border-radius: 8px; border: 1px solid #dbe3ee;
  transition: background .1s, border-color .1s;
}
.ann-move-card:hover { background: #f8fbff; border-color: #93c5fd; }
.ann-move-card-thumb { flex-shrink: 0; width: 104px; height: 104px; }
.ann-move-card-thumb img {
  display: block; width: 104px; height: 104px;
  object-fit: contain; border-radius: 5px;
  border: 1px solid #e2e8f0; background: #f8fafc;
}
.ann-move-no-preview {
  display: flex; align-items: center; justify-content: center;
  width: 104px; height: 104px; border-radius: 5px;
  background: #f1f5f9; color: #94a3b8; font-size: 12px;
}
.ann-move-card-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ann-move-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-move-row-cid { font-weight: 800; font-size: 14px; color: #0f172a; }
.ann-move-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.ann-move-badge-jersey { background: #dbeafe; color: #1d4ed8; }
.ann-move-badge-empty { background: #f1f5f9; color: #64748b; }
.ann-move-features {
  font-size: 13px; font-weight: 600; color: #334155;
  line-height: 1.35;
}
.ann-move-card-memo {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}
.ann-move-card-memo-label {
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  color: #be123c;
}
.ann-move-card-memo-text {
  font-size: 13px; font-weight: 700; color: #881337;
  line-height: 1.4;
  word-break: break-word;
}
.ann-move-card-meta {
  font-size: 11px; color: #64748b;
  line-height: 1.4;
}
.ann-move-btn {
  font-size: 11px; padding: 2px 8px; border: 1px solid #cbd5e1;
  border-radius: 4px; background: #f8fafc; color: #475569;
  cursor: pointer; white-space: nowrap;
}
.ann-move-btn:hover { background: #e2e8f0; border-color: #94a3b8; }
.ann-set-cover-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 1px 3px; border-radius: 3px;
  opacity: 0.5; transition: opacity .15s;
}
.ann-set-cover-btn:hover { opacity: 1; }
@media (max-width: 720px) {
  .ann-move-grid { grid-template-columns: 1fr; }
}
