:root {
  --bg: #101820;
  --bg-2: #17212b;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef6ff;
  --muted: #96a9bb;
  --muted-2: #71879b;
  --blue: #67b7ff;
  --green: #78e8c6;
  --amber: #e7b23f;
  --red: #ff7e79;
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 0;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(47, 131, 255, 0.14), transparent 28%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 44%, #1b2128 100%);
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  line-height: 1.35;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: rgba(12, 19, 27, 0.9);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand strong {
  display: block;
  font-size: 22px;
  letter-spacing: 0;
}

.brand span,
.section-kicker,
.side-summary span,
.side-summary em {
  color: var(--muted);
  font-size: 13px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #0f1720;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #aab8c8;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(84, 156, 255, 0.16);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.side-section {
  display: grid;
  gap: 10px;
}

.line-list {
  display: grid;
  gap: 10px;
}

.line-button {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #dce8f5;
  text-align: left;
}

.line-button:hover,
.line-button.selected {
  border-color: rgba(103, 183, 255, 0.68);
  background: rgba(103, 183, 255, 0.12);
}

.line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.line-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.line-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(120, 232, 198, 0.1);
}

.status-dot.warning {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(231, 178, 63, 0.12);
}

.side-summary {
  margin-top: auto;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 8px;
  background: rgba(120, 232, 198, 0.09);
  border: 1px solid rgba(120, 232, 198, 0.2);
}

.side-summary strong {
  font-size: 18px;
}

.side-summary em {
  font-style: normal;
}

.main {
  min-width: 0;
  min-height: 100vh;
  padding: 24px 28px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 16px;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  color: var(--green);
  font-size: 13px;
}

h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented {
  height: 40px;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.segmented button {
  height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: #0d1720;
  background: var(--green);
}

.field,
.search-box,
.ghost-btn,
.small-btn {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.field {
  padding: 0 12px;
}

.risk-field {
  width: 132px;
}

.search-box {
  width: 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.search-box span {
  width: 13px;
  height: 13px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.search-box span::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -6px;
  bottom: -4px;
  background: var(--muted);
  transform: rotate(45deg);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.ghost-btn,
.small-btn {
  padding: 0 14px;
}

.small-btn {
  height: 34px;
}

.ghost-btn:hover,
.small-btn:hover {
  border-color: rgba(103, 183, 255, 0.7);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  border-radius: 8px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--shadow);
}

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}

.kpi[data-tone="blue"] .kpi-icon {
  color: var(--blue);
  background: rgba(103, 183, 255, 0.14);
}

.kpi[data-tone="green"] .kpi-icon {
  color: var(--green);
  background: rgba(120, 232, 198, 0.14);
}

.kpi[data-tone="amber"] .kpi-icon {
  color: var(--amber);
  background: rgba(231, 178, 63, 0.16);
}

.kpi[data-tone="red"] .kpi-icon {
  color: var(--red);
  background: rgba(255, 126, 121, 0.15);
}

.kpi span,
.kpi small,
.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin: 5px 0 4px;
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

.kpi em {
  margin-left: 4px;
  color: #aebdca;
  font-style: normal;
  font-size: 15px;
}

.workspace {
  min-width: 0;
  min-height: calc(100vh - 136px);
  display: grid;
  grid-template-columns: minmax(520px, 0.9fr) minmax(440px, 1.1fr);
  align-items: stretch;
  gap: 16px;
}

.video-panel {
  overflow: hidden;
}

.check-panel {
  min-height: calc(100vh - 136px);
  max-height: none;
}

.lower-grid {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 0.9fr 1.25fr 0.75fr;
  gap: 16px;
}

.panel {
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel.check-panel {
  min-height: calc(100vh - 136px);
}

.video-panel,
.check-panel,
.alert-panel,
.evidence-panel,
.queue-panel,
.policy-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 18px;
}

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

.online-badge,
.tag,
.risk-tag,
.time-chip,
.status-pill {
  border-radius: 999px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dff8ff;
  background: rgba(120, 232, 198, 0.12);
  border: 1px solid rgba(120, 232, 198, 0.28);
  font-size: 12px;
  white-space: nowrap;
}

.tag.blue {
  color: #dceeff;
  background: rgba(103, 183, 255, 0.13);
  border-color: rgba(103, 183, 255, 0.34);
}

.time-chip {
  color: var(--amber);
  background: rgba(231, 178, 63, 0.12);
  border-color: rgba(231, 178, 63, 0.28);
}

.video-stage {
  width: 100%;
  max-width: 960px;
  max-height: min(54vh, 540px);
  aspect-ratio: 16 / 9;
  flex: none;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #050a12;
}

.video-stage img,
.video-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: none;
}

.video-stage video {
  background: #081019;
}

.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.video-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 10, 18, 0.46), transparent 28%, rgba(5, 10, 18, 0.58));
}

.hud-top {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hud-top span {
  border-radius: 6px;
  padding: 7px 10px;
  color: #dff8ff;
  background: rgba(5, 10, 18, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
}

.video-caption {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  bottom: 16px;
  border-radius: 8px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  background: rgba(5, 10, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.video-caption strong {
  font-size: 18px;
}

.video-caption span {
  color: #b9c8d6;
}

.caption-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-progress {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.13);
}

.video-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.timeline-strip {
  max-width: 100%;
  height: 66px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  contain: paint;
  padding-bottom: 2px;
}

.timeline-step {
  min-width: 112px;
  flex: 1 0 112px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 8px auto;
  column-gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-align: left;
}

.timeline-step.pending {
  opacity: 0.58;
}

.timeline-step.completed {
  background: rgba(120, 232, 198, 0.08);
}

.timeline-step.warn,
.timeline-step.fail {
  background: rgba(231, 178, 63, 0.1);
}

.timeline-step.fail {
  background: rgba(255, 126, 121, 0.1);
}

.timeline-step.active {
  border-color: var(--step-color);
  background: rgba(103, 183, 255, 0.12);
}

.timeline-step::before {
  content: "";
  width: 8px;
  height: 36px;
  border-radius: 6px;
  grid-row: span 2;
  background: var(--step-color);
}

.timeline-step strong {
  color: #fff;
  font-size: 14px;
}

.timeline-step em {
  color: #9fb0c0;
  font-style: normal;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #17212b 58%, transparent 59%),
    conic-gradient(var(--green) 0 86%, rgba(255, 255, 255, 0.12) 86% 100%);
  color: var(--green);
  font-weight: 800;
}

.step-list,
.alert-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding-right: 3px;
}

.step-item {
  border-radius: 8px;
  min-height: 54px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--step-color);
}

.step-item.active {
  background: rgba(103, 183, 255, 0.1);
  border-color: rgba(103, 183, 255, 0.32);
  border-left-color: var(--step-color);
}

.step-item.pending {
  opacity: 0.66;
}

.step-item.completed {
  background: rgba(120, 232, 198, 0.07);
}

.step-item.warn {
  background: rgba(231, 178, 63, 0.08);
}

.step-item.fail {
  background: rgba(255, 126, 121, 0.08);
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--step-color);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.step-content {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.step-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.step-state {
  border-radius: 999px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dce8f5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 12px;
  white-space: nowrap;
}

.step-state.active {
  color: #dceeff;
  background: rgba(103, 183, 255, 0.15);
  border-color: rgba(103, 183, 255, 0.36);
}

.step-state.completed {
  color: #e5fff7;
  background: rgba(120, 232, 198, 0.13);
  border-color: rgba(120, 232, 198, 0.32);
}

.step-state.warn {
  color: #fff4d8;
  background: rgba(231, 178, 63, 0.16);
  border-color: rgba(231, 178, 63, 0.36);
}

.step-state.fail {
  color: #ffe9e7;
  background: rgba(255, 126, 121, 0.16);
  border-color: rgba(255, 126, 121, 0.36);
}

.step-content p,
.step-content span,
.step-meta em {
  margin: 0;
  color: #9fb0c0;
  font-style: normal;
  font-size: 12px;
}

.step-content span {
  color: #d6e3ee;
}

.step-meta {
  display: flex;
  gap: 16px;
}

.risk-tag.high,
.status-pill.fail {
  color: #ffe9e7;
  background: rgba(255, 126, 121, 0.16);
  border-color: rgba(255, 126, 121, 0.36);
}

.risk-tag.mid,
.status-pill.pending {
  color: #fff4d8;
  background: rgba(231, 178, 63, 0.16);
  border-color: rgba(231, 178, 63, 0.36);
}

.risk-tag.low,
.status-pill.pass {
  color: #e5fff7;
  background: rgba(120, 232, 198, 0.13);
  border-color: rgba(120, 232, 198, 0.32);
}

.alert-item {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 13px;
  background: var(--panel-2);
  color: #eff6ff;
  text-align: left;
}

.alert-item:hover,
.alert-item.selected {
  border-color: rgba(103, 183, 255, 0.65);
  background: rgba(103, 183, 255, 0.11);
}

.alert-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alert-item strong {
  display: block;
  margin-top: 10px;
  font-size: 16px;
}

.alert-item p {
  margin: 7px 0;
  color: #a9bac9;
  font-size: 13px;
  line-height: 1.5;
}

.alert-item em,
.alert-top span {
  color: #8296aa;
  font-style: normal;
  font-size: 13px;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.evidence-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.evidence-item {
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(6, 12, 20, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.evidence-item img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  display: block;
}

.source-card {
  min-height: 168px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.source-card strong {
  color: #fff;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.source-card p {
  margin: 0;
  color: #a9bac9;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.source-kicker {
  color: var(--green);
  font-size: 13px;
}

.evidence-info {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.evidence-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.evidence-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-title span {
  color: var(--muted);
  font-size: 12px;
}

.progress {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.progress span {
  display: block;
  width: var(--progress);
  height: 100%;
  background: var(--progress-color);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.table-wrap {
  min-height: 0;
  overflow: auto;
}

.review-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13px;
}

.review-table th,
.review-table td {
  height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
}

.review-table th {
  color: #9fb0c0;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 600;
}

.review-table td {
  color: #dce8f5;
  background: rgba(255, 255, 255, 0.025);
}

.review-table tr:hover td {
  background: rgba(103, 183, 255, 0.1);
}

.batch-cell {
  display: grid;
  gap: 3px;
}

.batch-cell em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.score-text {
  color: var(--green);
  font-weight: 800;
}

.table-actions {
  display: flex;
  gap: 6px;
}

.table-actions button {
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.table-actions button.danger {
  color: #ffe9e7;
  border-color: rgba(255, 126, 121, 0.45);
}

.policy-body {
  display: grid;
  gap: 18px;
}

.threshold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.threshold-head span {
  color: #9fb0c0;
}

.threshold-head strong {
  color: var(--green);
  font-size: 28px;
}

.range {
  width: 100%;
  accent-color: var(--green);
}

.switch-row {
  border-radius: 8px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.switch-row div {
  display: grid;
  gap: 5px;
}

.switch-row span {
  color: var(--muted);
  font-size: 13px;
}

.switch {
  width: 50px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 3px;
  background: #53606c;
}

.switch span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch.on {
  background: var(--green);
}

.switch.on span {
  transform: translateX(22px);
}

.policy-hint {
  border-radius: 8px;
  padding: 13px;
  color: #dce8f5;
  background: rgba(231, 178, 63, 0.12);
  border: 1px solid rgba(231, 178, 63, 0.23);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 1500px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .main {
    grid-template-rows: auto;
  }

  .workspace {
    grid-template-columns: 1fr minmax(340px, 0.85fr);
  }

  .video-panel {
    grid-row: auto;
  }

  .check-panel,
  .alert-panel {
    max-height: none;
  }

  .alert-panel {
    display: none;
  }

  .lower-grid {
    grid-template-columns: 1fr 1fr;
  }

  .policy-panel {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    padding: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-summary {
    margin-top: 0;
  }

  .main {
    padding: 16px;
    grid-template-rows: auto;
  }

  .toolbar,
  .segmented,
  .search-box {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    padding: 0 8px;
  }

  .risk-field {
    width: calc(50% - 5px);
  }

  .ghost-btn {
    width: calc(50% - 5px);
  }

  .kpi-grid,
  .workspace,
  .lower-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

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

  .video-stage {
    flex: none;
    aspect-ratio: 16 / 9;
    max-height: none;
    min-height: 260px;
  }

  .alert-panel,
  .policy-panel {
    display: flex;
  }

  .caption-row,
  .hud-top,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hud-top {
    right: auto;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 12px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 12px;
  }

  .video-stage {
    min-height: 220px;
  }

  .review-table {
    min-width: 560px;
  }
}
