* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #1f2933;
}
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #111827;
  color: #fff;
}
.brand { font-weight: 700; }
.topbar a, .link-button {
  color: #e5e7eb;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}
.inline-form { display: inline; }
.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.page {
  max-width: 1120px;
  margin: 24px auto;
  padding: 0 20px;
}
.panel, .workspace, .auth-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
}
.narrow { max-width: 720px; margin: 0 auto; }
.section-title, .task-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
h1 { margin: 0 0 8px; font-size: 24px; }
h2 { font-size: 18px; margin: 0 0 12px; }
p { margin: 0; color: #697586; }
.task-list, .batch-list { display: grid; gap: 10px; }
.task-row {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: #fbfcfd;
}
.task-row em { color: #697586; font-style: normal; }
.batch-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcfd;
}
.batch-id {
  font-weight: 700;
  font-size: 18px;
}
.batch-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.batch-main strong {
  font-size: 18px;
}
.batch-main em {
  color: #697586;
  font-style: normal;
}
.batch-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.audio-panel {
  margin: 18px 0;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
audio { width: 100%; }
.meta-line { margin-top: 8px; color: #697586; font-size: 14px; }
.notice {
  padding: 12px 14px;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 16px;
}
.notice.strong {
  background: #fff7ed;
  border-color: #fed7aa;
}
.annotation-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
legend {
  font-weight: 700;
  margin-bottom: 10px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}
.choice-grid.small { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.choice input { display: none; }
.choice span {
  display: block;
  min-height: 44px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  background: #fff;
}
.choice input:checked + span {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}
.text-label { display: grid; gap: 8px; margin: 14px 0; font-weight: 700; }
textarea, input[type=text], input[type=password], input[type=number], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}
.primary, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.primary:hover, .button:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .18);
}
.button.secondary {
  background: #eaf1ff;
  border-color: #c7d7fe;
  color: #1d4ed8;
}
.button.secondary:hover {
  background: #dbe8ff;
  border-color: #9bbcff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .12);
}
.primary:disabled,
.button:disabled,
.button.is-disabled,
.button.is-disabled:hover {
  background: #e5e7eb;
  border-color: #e5e7eb;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.small-button { min-height: 32px; font-size: 13px; }
.action-button {
  min-width: 112px;
  min-height: 44px;
  font-size: 15px;
}
.task-action-bar {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
.task-action-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.task-action-primary {
  justify-content: flex-end;
}
.action-nav {
  min-width: 96px;
}
.action-submit {
  min-width: 184px;
  min-height: 44px;
}
.form-card { display: grid; gap: 14px; max-width: 560px; }
.form-card label { display: grid; gap: 6px; font-weight: 700; }
.algorithm-box {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.metric-grid div {
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}
.metric-grid span { display: block; color: #697586; font-size: 13px; }
.metric-grid strong { font-size: 18px; }
.review-list { display: grid; gap: 18px; }
.review-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}
.review-card.review-bad {
  background: #fff1f2;
  border-color: #fecdd3;
}
.review-card.review-warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.review-card.review-good {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.review-card.review-quality {
  background: #f5f3ff;
  border-color: #ddd6fe;
}
.review-card-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
.comment {
  margin-top: 12px;
  padding: 10px;
  background: #fffbeb;
  border-radius: 8px;
}
.trace {
  margin-top: 8px;
  word-break: break-all;
  color: #697586;
}
.messages { display: grid; gap: 8px; margin-bottom: 16px; }
.message { padding: 10px 12px; border-radius: 8px; background: #ecfdf3; border: 1px solid #bbf7d0; }
.empty-state {
  padding: 28px;
  text-align: center;
  color: #697586;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}
@media (max-width: 720px) {
  .task-row { grid-template-columns: 1fr; }
  .batch-row { grid-template-columns: 1fr; }
  .batch-actions { width: 100%; }
  .action-button { flex: 1; width: auto; }
  .task-action-bar { position: static; flex-direction: column; align-items: stretch; }
  .task-action-group { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-action-primary { grid-template-columns: 1fr; }
  .action-nav, .action-submit { width: 100%; min-width: 0; }
  .compare-grid { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: 14px; align-items: flex-start; gap: 10px; }
}
