:root {
  --primary: #2f6bff;
  --primary-dark: #1e4fd6;
  --primary-light: #7aa2ff;
  --bg-page: #f7f9fc;
  --bg-card: #ffffff;
  --bg-soft: #eef3ff;
  --text-strong: #1a1d26;
  --text-muted: #5a6072;
  --text-invert: #ffffff;
  --success: #22a06b;
  --danger: #e5484d;
  --warning: #f5a623;
  --info: #3b82f6;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(26, 29, 38, 0.04), 0 8px 24px rgba(26, 29, 38, 0.06);
  --shadow-hover: 0 2px 4px rgba(26, 29, 38, 0.06), 0 12px 32px rgba(47, 107, 255, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-strong);
  background:
    radial-gradient(1200px 400px at 50% -120px, var(--bg-soft), transparent),
    var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* 顶部 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  box-shadow: 0 6px 16px rgba(47, 107, 255, 0.28);
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.25s ease;
}

.dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.14);
}

.dot.bad {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.14);
}

/* 卡片 */
.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  animation: fade-up 0.32s ease both;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.hint-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* 上传区 */
.dropzone {
  border: 1.5px dashed rgba(47, 107, 255, 0.32);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(238, 243, 255, 0.6), rgba(255, 255, 255, 0.4));
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--primary);
  background: var(--bg-soft);
  transform: translateY(-1px);
  outline: none;
}

.dropzone.dragging {
  border-color: var(--primary);
  background: var(--bg-soft);
  transform: scale(1.005);
}

.dropzone.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: rgba(47, 107, 255, 0.1);
}

.dropzone-icon svg {
  width: 22px;
  height: 22px;
}

.dropzone-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 500;
}

.dropzone-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.file-meta {
  margin-top: 18px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.file-row.sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.file-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

/* 进度条 */
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(26, 29, 38, 0.07);
  overflow: hidden;
}

.progress-track.large {
  height: 8px;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  transition: width 0.35s ease;
}

.progress-fill.analyze {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  position: relative;
}

.progress-fill.analyze.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.5s linear infinite;
}

/* 指标 */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.metric {
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.metric-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stage-text {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(59, 130, 246, 0.12);
  color: var(--info);
}

.badge.done {
  background: rgba(34, 160, 107, 0.12);
  color: var(--success);
}

.badge.fail {
  background: rgba(229, 72, 77, 0.12);
  color: var(--danger);
}

.badge.wait {
  background: rgba(245, 166, 35, 0.14);
  color: #a4690d;
}

/* 回合列表 */
.rally-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rally-item {
  border: 1px solid rgba(26, 29, 38, 0.07);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--bg-card);
  transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
  animation: fade-up 0.3s ease both;
}

.rally-item:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(47, 107, 255, 0.24);
  transform: translateY(-1px);
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.item-time {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

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

.tag {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--primary-dark);
  white-space: nowrap;
}

.tag.muted {
  background: rgba(26, 29, 38, 0.05);
  color: var(--text-muted);
}

.item-body {
  margin-top: 12px;
}

.item-video {
  width: 100%;
  max-height: 320px;
  border-radius: var(--radius-sm);
  background: #000;
  display: block;
}

.item-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.link-btn {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  transition: background 0.2s ease, color 0.2s ease;
}

.link-btn:hover {
  background: var(--primary);
  color: var(--text-invert);
}

/* ---------- 高光评定 ---------- */

.result-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-hint {
  margin: -8px 0 14px;
}

.sort-toggle {
  display: inline-flex;
  border: 1px solid rgba(26, 29, 38, 0.12);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-card);
}

.sort-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
}

.sort-btn.active {
  background: var(--primary);
  color: var(--text-invert);
}

.recalc-btn {
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
}

.recalc-btn:hover {
  background: rgba(47, 107, 255, 0.08);
}

.recalc-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.item-highlight {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.hl-badge {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.hl-badge.high {
  background: linear-gradient(135deg, #ffc25e, #f5a623);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(245, 166, 35, 0.38);
}

.hl-badge.medium {
  background: rgba(47, 107, 255, 0.12);
  color: var(--primary-dark);
}

.hl-badge.normal {
  background: rgba(26, 29, 38, 0.06);
  color: var(--text-muted);
}

.hl-score-track {
  width: 76px;
  height: 5px;
  border-radius: 999px;
  background: rgba(26, 29, 38, 0.07);
  overflow: hidden;
  flex-shrink: 0;
}

.hl-score-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd27a, #f5a623);
  transition: width 0.3s ease;
}

.hl-score-fill.medium {
  background: linear-gradient(90deg, #9db9ff, #2f6bff);
}

.hl-score-fill.normal {
  background: #9aa1b4;
}

.hl-score-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tag.hl {
  background: rgba(245, 166, 35, 0.12);
  color: #a4690d;
}

.tag.moment {
  background: rgba(26, 29, 38, 0.05);
  color: var(--text-muted);
}

.hl-precision {
  font-size: 11px;
  color: var(--text-muted);
}

.reel-panel {
  padding: 14px 16px;
  border: 1px dashed rgba(245, 166, 35, 0.45);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.06), rgba(255, 255, 255, 0.5));
  margin-bottom: 16px;
}

.reel-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.reel-title {
  font-weight: 600;
  font-size: 13px;
}

.reel-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
}

.reel-mode:has(input:checked) {
  color: var(--text-strong);
  font-weight: 500;
}

.reel-top {
  font-size: 13px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reel-top input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid rgba(26, 29, 38, 0.14);
  border-radius: 8px;
  font: inherit;
  color: var(--text-strong);
  background: var(--bg-card);
}

.reel-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.reel-status.busy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reel-status.busy::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(245, 166, 35, 0.3);
  border-top-color: #f5a623;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.reel-status.ok {
  color: var(--success);
}

.reel-status.fail {
  color: var(--danger);
}

.pending-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(47, 107, 255, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.retry-btn {
  margin-top: 14px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--text-invert);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.retry-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.retry-btn.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.retry-btn.secondary:hover {
  background: rgba(47, 107, 255, 0.08);
}

.retry-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.retry-row .retry-btn {
  margin-top: 14px;
}

/* ---------- 算法选择与球场标定 ---------- */

.algorithm-picker {
  margin-top: 16px;
}

.match-type-picker {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.match-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.algo-option.compact {
  margin-bottom: 0;
}

.picker-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.algo-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.algo-option:hover {
  border-color: var(--primary);
}

.algo-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(47, 107, 255, 0.06);
}

.algo-option input {
  margin-top: 3px;
}

.algo-text {
  color: var(--text);
  line-height: 1.5;
}

.algo-text strong {
  font-weight: 600;
}

.algo-text-line {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.court-picker {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.court-manual {
  margin-top: 10px;
}

.court-manual summary {
  font-size: 13px;
  color: var(--primary, #3b82f6);
  cursor: pointer;
  user-select: none;
}

.court-manual summary:hover {
  text-decoration: underline;
}

.court-manual[open] summary {
  margin-bottom: 6px;
}

#courtCanvas {
  display: block;
  width: 100%;
  max-width: 640px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  cursor: crosshair;
  background: #000;
}

.court-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.court-buttons {
  display: flex;
  gap: 8px;
}

.court-buttons .button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.court-count {
  font-size: 13px;
  color: var(--text-muted);
}

.picker-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.error-text {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(229, 72, 77, 0.08);
  color: var(--danger);
  font-size: 13px;
}

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

.review-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.review-heading,
.review-actions,
.review-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-heading {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.review-heading h3,
.review-heading p {
  margin: 0;
}

.review-heading p,
.review-message {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 13px;
}

.review-video {
  display: block;
  width: 100%;
  max-height: 460px;
  border-radius: var(--radius-sm);
  background: #101828;
}

.review-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  align-items: start;
}

.review-capture {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.review-current-time {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.review-current-time strong {
  color: var(--text-main);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.review-capture .button {
  width: 100%;
}

.review-mark-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.review-capture-hint {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.review-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
}

.review-list-heading span {
  color: var(--text-muted);
  font-size: 12px;
}

.review-list {
  display: grid;
  gap: 10px;
  max-height: 390px;
  padding: 2px 4px 2px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.review-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.review-row:hover {
  border-color: rgba(80, 70, 229, 0.35);
}

.review-row.active {
  border-color: var(--primary);
  background: rgba(80, 70, 229, 0.05);
  box-shadow: 0 0 0 2px rgba(80, 70, 229, 0.12);
}

.review-field {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.review-field input {
  width: 110px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  background: var(--bg-card);
}

.review-field.note {
  flex: 1;
}

.review-field.note input {
  width: 100%;
}

.action-label-panel {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.action-label-heading {
  margin-bottom: 12px;
}

.action-label-warning {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(229, 145, 35, 0.28);
  border-radius: var(--radius-sm);
  color: #9a5b0a;
  background: rgba(229, 145, 35, 0.08);
  font-size: 13px;
}

.action-label-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.action-label-summary span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-muted);
  background: var(--bg-soft);
  font-size: 12px;
}

.action-label-summary strong {
  color: var(--text-main);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.action-label-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.capture-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.capture-divider::before,
.capture-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.review-capture .action-label-tools {
  grid-template-columns: 1fr;
}

.review-capture .action-tool-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-capture .action-tool-group strong {
  grid-column: 1 / -1;
}

.action-quick-status {
  margin: 0;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(102, 112, 133, 0.08);
  font-size: 12px;
  line-height: 1.45;
}

.action-quick-status.pending {
  color: #7a5200;
  background: rgba(229, 145, 35, 0.12);
}

.action-quick-status.success {
  color: #087454;
  background: rgba(29, 158, 117, 0.12);
}

.action-quick-status.error {
  color: var(--danger);
  background: rgba(229, 72, 77, 0.09);
}

.action-tool-group {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.action-tool-group strong {
  font-size: 13px;
}

.action-tool-group.pickball {
  border-color: rgba(29, 158, 117, 0.28);
  background: rgba(29, 158, 117, 0.05);
}

.action-list-heading {
  margin-top: 14px;
}

.action-label-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.action-label-row {
  display: grid;
  grid-template-columns: 64px 120px 120px 1fr;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.action-label-badge {
  align-self: center;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
  color: #087454;
  background: rgba(29, 158, 117, 0.12);
  font-size: 12px;
}

.action-label-row.ignore .action-label-badge {
  color: var(--text-muted);
  background: rgba(102, 112, 133, 0.12);
}

.button {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.button.primary {
  color: var(--text-invert);
  background: var(--primary);
}

.button.secondary {
  color: var(--primary-dark);
  border-color: var(--border);
  background: var(--bg-card);
}

.button.danger {
  color: var(--danger);
  border-color: rgba(229, 72, 77, 0.25);
  background: rgba(229, 72, 77, 0.06);
}

.footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* 动画 */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 860px) {
  .review-workspace {
    grid-template-columns: 1fr;
  }

  .review-capture {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-current-time,
  .review-capture-hint {
    grid-column: 1 / -1;
  }

  .action-label-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-label-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 14px 36px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dropzone {
    padding: 30px 16px;
  }

  .review-heading,
  .review-row {
    align-items: stretch;
    flex-direction: column;
  }

  .review-actions {
    flex-wrap: wrap;
  }

  .review-capture {
    grid-template-columns: 1fr;
  }

  .review-current-time,
  .review-capture-hint {
    grid-column: auto;
  }

  .review-list-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .action-tool-group,
  .action-label-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .review-field input {
    box-sizing: border-box;
    width: 100%;
  }
}
