:root {
  --bg: #f3f5f8;
  --panel: #fff;
  --ink: #172033;
  --muted: #667085;
  --line: #dce2e9;
  --brand: #087f6d;
  --brand-soft: #e9f7f3;
  --warn: #a76516;
  --danger: #b63d37;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); letter-spacing: 0; }
body.sample-evidence-only .creator-pane { display: none; }
body.sample-evidence-only .workspace { grid-template-columns: minmax(0, 1fr); }
body.sample-evidence-only .topbar { height: auto; min-height: 58px; flex-wrap: wrap; padding: 12px 16px; }
body.sample-evidence-only .topbar > div { min-width: 0; flex-wrap: wrap; }
body.sample-evidence-only .topbar span { display: none; }
body.sample-evidence-only .topbar a { overflow-wrap: anywhere; }
body.sample-evidence-only .review-heading > div { min-width: 0; }
body.sample-evidence-only #creatorName { overflow-wrap: anywhere; }
body.sample-evidence-only #profileLink { flex-shrink: 0; white-space: nowrap; }
button, input, select, textarea { font: inherit; }
#sampleContext { padding: 10px 22px; border-bottom: 1px solid var(--line); background: var(--brand-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
@media (min-width: 901px) {
  body:has(#sampleContext:not([hidden])) { height: 100dvh; display: grid; grid-template-rows: 58px auto minmax(0, 1fr); }
  body:has(#sampleContext:not([hidden])) .workspace { height: 100%; min-height: 0; }
}

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar div { display: flex; align-items: baseline; gap: 12px; }
.topbar strong { font-size: 17px; }
.topbar span { color: var(--muted); font-size: 12px; }
.topbar a { color: var(--brand); text-decoration: none; font-weight: 700; }

.workspace {
  height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}
.creator-pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.pane-heading { padding: 20px 18px 12px; }
.pane-heading h1 { margin: 0 0 5px; font-size: 20px; }
.pane-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.filters {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.filters #batchFilter { grid-column: 1 / -1; }
.filters input, .filters select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
}
.creator-list {
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #98a2b3 #eef1f4;
}
.creator-list::-webkit-scrollbar { width: 10px; }
.creator-list::-webkit-scrollbar-track { background: #eef1f4; }
.creator-list::-webkit-scrollbar-thumb {
  background: #98a2b3;
  border: 2px solid #eef1f4;
  border-radius: 5px;
}
.creator-list::-webkit-scrollbar-thumb:hover { background: #667085; }
.creator-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
  padding: 13px 16px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.creator-row:hover { background: #f8fafb; }
.creator-row.active { background: var(--brand-soft); box-shadow: inset 3px 0 var(--brand); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #f1d4b7; color: #6d3f1f; font-weight: 900; }
.creator-copy { min-width: 0; display: grid; gap: 3px; }
.creator-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator-copy span, .video-count { color: var(--muted); font-size: 12px; }
.creator-name-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.creator-name-row strong { min-width: 0; }
.creator-name-row .review-date {
  flex: 0 0 auto;
  color: #98a2b3;
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.review-pane { min-width: 0; overflow-y: auto; padding: 20px 24px 34px; }
.empty-state { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 7px; color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 18px; }
.review-heading { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 14px; }
.review-heading h2 { margin: 3px 0; font-size: 23px; }
.review-heading span { color: var(--muted); font-size: 12px; }
.creator-key-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.creator-key-metrics span { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 7px; color: #475467; font-size: 11px; }
.eyebrow { color: var(--brand); font-weight: 800; font-size: 12px; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; cursor: pointer; font-weight: 800; }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.secondary { background: #fff; color: var(--ink); }

.creator-fit-options { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.creator-fit-options button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.creator-fit-options button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.creator-fit-options button.active[data-creator-fit="not_fit"] { border-color: var(--danger); background: #fff0ef; color: var(--danger); }
.creator-fit-options button.active[data-creator-fit="observe"] { border-color: var(--warn); background: #fff6e7; color: var(--warn); }

.video-tabs { display: flex; gap: 7px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.video-tabs button { min-width: 92px; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 10px; cursor: pointer; text-align: left; }
.video-tabs button strong, .video-tabs button span { display: block; }
.video-tabs button span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.video-tabs button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.review-grid { display: grid; grid-template-columns: minmax(440px, 58%) minmax(330px, 42%); gap: 16px; align-items: start; }
.player-column { position: sticky; top: 0; }
.video-stage { position: relative; background: #10151c; }
video { display: block; width: 100%; max-height: calc(100vh - 220px); min-height: 420px; background: #10151c; object-fit: contain; }
.poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: #10151c;
  cursor: pointer;
}
.poster-overlay img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: rgb(0 0 0 / 62%);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 35%);
}
.poster-overlay:hover .poster-play { background: rgb(0 0 0 / 78%); }
.player-actions { min-height: 45px; background: #fff; border: 1px solid var(--line); border-top: 0; padding: 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.player-actions span { color: var(--muted); font-size: 12px; }
.player-actions a { color: var(--brand); font-weight: 800; text-decoration: none; }
.speed-control { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.speed-control select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 0 7px;
}
.evidence-column { background: #fff; border: 1px solid var(--line); }
.evidence-section { padding: 15px 17px; border-bottom: 1px solid var(--line); }
.evidence-section:last-child { border-bottom: 0; }
.evidence-section h3 { margin: 0 0 10px; font-size: 15px; }
.metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.metrics span { background: #f1f4f7; border-radius: 4px; padding: 5px 7px; font-size: 12px; }
.video-title, .transcript { line-height: 1.55; overflow-wrap: anywhere; }
.transcript { max-height: 230px; overflow-y: auto; white-space: pre-wrap; }
.transcript-fallback[hidden] { display: none !important; }
.transcript-zh-full {
  margin-bottom: 10px;
  padding: 11px 12px;
  border: 1px solid #b9d8d1;
  border-radius: 6px;
  background: #f3fbf8;
}
.transcript-zh-full strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12px;
}
.transcript-zh-full p {
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  color: #354052;
  line-height: 1.65;
  white-space: pre-wrap;
}
.segment-transcript {
  max-height: 360px;
  overflow-y: auto;
  display: grid;
  gap: 7px;
  padding-right: 4px;
}
.transcript-segment {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.transcript-segment:hover { background: #f8fafb; border-color: #b9c6d2; }
.transcript-segment.needs-replay { border-color: #e9a85c; background: #fff9f1; }
.segment-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.segment-copy { min-width: 0; display: grid; gap: 4px; line-height: 1.45; }
.segment-es { color: var(--ink); }
.segment-zh { color: #526078; }
.segment-zh.pending { color: var(--muted); font-style: italic; }
.replay-badge { color: #b95e12; font-size: 12px; white-space: nowrap; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; }
.product-tag-preview { display: none; }
.product-tag-preview span { border: 1px solid #b8d7cf; background: #edf8f5; color: #087763; border-radius: 6px; padding: 3px 7px; font-size: 12px; }
.save-state { margin-left: 9px; color: var(--muted); font-size: 12px; }
.audit-workbench { padding: 0; overflow: hidden; }
.audit-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.audit-heading h3 { margin: 0 0 3px; font-size: 15px; }
.audit-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.audit-heading .save-state { margin: 0; text-align: right; }
.audit-block { padding: 13px 14px; }
.audit-block + .audit-block { border-top: 1px solid var(--line); }
.audit-block-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.audit-block-heading strong { font-size: 13px; }
.audit-block-heading span { color: var(--muted); font-size: 11px; }
.audit-block label { display: block; margin: 10px 0 6px; font-weight: 700; font-size: 12px; }
.audit-block input, .audit-block textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 9px 10px; }
.audit-block textarea { min-height: 66px; resize: vertical; margin-bottom: 10px; }
.ai-suggestion { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-left: 3px solid #7a91b2; background: #f4f7fb; color: #475467; font-size: 12px; }
.ai-suggestion strong { color: #334155; white-space: nowrap; }
.inline-save-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.source-category-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; color: var(--muted); font-size: 12px; }
.source-category-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #c9d3df; border-radius: 6px; background: #f7f9fc; padding: 5px 7px; }
.source-category-chip strong { color: var(--ink); font-size: 12px; }
.source-category-chip small { color: #526b8d; font-size: 10px; }
.category-tag-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 6px 8px; cursor: text; }
.category-tag-editor:focus-within { border-color: #1769e0; box-shadow: 0 0 0 2px rgba(23, 105, 224, 0.14); }
.category-tag-list { display: contents; }
.editable-category-chip { position: relative; display: inline-flex; align-items: center; min-height: 30px; border: 1px solid #9ecfc3; border-radius: 6px; background: #edf8f5; color: #075f52; padding: 6px 24px 6px 9px; font-size: 12px; line-height: 1.2; }
.editable-category-chip button { position: absolute; top: 1px; right: 2px; width: 17px; height: 17px; border: 0; border-radius: 3px; background: transparent; color: #52766f; padding: 0; cursor: pointer; font-size: 11px; line-height: 17px; }
.editable-category-chip button:hover, .editable-category-chip button:focus-visible { background: #d9efea; color: var(--danger); outline: none; }
.audit-block input.category-tag-input { flex: 1 1 150px; min-width: 130px; width: auto; border: 0; border-radius: 0; padding: 6px 2px; box-shadow: none; outline: none; }

@media (max-width: 980px) {
  .workspace { height: auto; grid-template-columns: 1fr; }
  .creator-pane { max-height: 420px; border-right: 0; border-bottom: 1px solid var(--line); }
  .review-grid { grid-template-columns: 1fr; }
  .player-column { position: static; }
  video { min-height: 320px; max-height: 70vh; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 14px; }
  .topbar span { display: none; }
  .review-pane { padding: 16px 12px 26px; }
  .filters { grid-template-columns: 1fr; }
  .review-heading { align-items: flex-start; }
  .review-heading h2 { font-size: 20px; }
  .audit-heading { display: grid; }
  .audit-heading .save-state { text-align: left; }
  .transcript-segment { grid-template-columns: 42px minmax(0, 1fr); }
  .replay-badge { grid-column: 2; white-space: normal; }
}
