:root {
  color-scheme: dark;
  --bg: #06152c;
  --bg-deep: #041025;
  --surface: #091b36;
  --surface-raised: #0d2140;
  --surface-soft: #0b1f3d;
  --line: #25425f;
  --line-strong: #3b5f83;
  --text: #f3f7ff;
  --muted: #9aabc2;
  --muted-quiet: #72839c;
  --cyan: #35d3f1;
  --cyan-strong: #16aee7;
  --cyan-soft: #a5eafa;
  --blue: #74a7ff;
  --success: #8fe64c;
  --success-soft: #c3f48e;
  --warning: #ffca5c;
  --danger: #ff6f79;
  --danger-soft: #ffabb1;
  --shadow: 0 24px 70px rgb(0 4 18 / 32%);
  --radius-lg: 14px;
  --radius-md: 10px;
  --font-ui: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", Inter, system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "DejaVu Sans Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -16%, rgb(25 92 145 / 18%), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgb(111 159 207 / 2.3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(111 159 207 / 2.3%) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="tab"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgb(70 103 137 / 52%);
  background: rgb(4 16 37 / 88%);
  backdrop-filter: blur(20px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  width: min(100% - 48px, 1450px);
  min-height: 70px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-self: start;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--cyan);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.brand-name {
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-label {
  padding: 3px 7px;
  border: 1px solid rgb(53 211 241 / 42%);
  border-radius: 5px;
  background: rgb(53 211 241 / 9%);
  color: var(--cyan-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.view-tabs {
  display: flex;
  align-self: stretch;
  gap: 32px;
  align-items: stretch;
  justify-content: center;
}

.view-tab {
  position: relative;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: color 160ms ease;
}

.view-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--cyan);
  content: "";
  opacity: 0;
  transform: scaleX(.4);
  transition: opacity 160ms ease, transform 160ms ease;
}

.view-tab:hover,
.view-tab.is-active {
  color: var(--text);
}

.view-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.count-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--warning);
  color: #142036;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
}

.demo-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgb(143 230 76 / 9%), 0 0 12px rgb(143 230 76 / 55%);
}

.app-shell {
  width: min(100% - 48px, 1450px);
  margin: 0 auto;
  padding: 36px 0 72px;
}

.app-view {
  animation: view-in 220ms ease-out both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 25px;
}

.view-header h1 {
  margin: 0;
  font-size: clamp(23px, 2.25vw, 31px);
  font-weight: 700;
  letter-spacing: -.035em;
}

.view-header h1 .mono {
  margin-left: 10px;
  color: var(--muted-quiet);
  font-size: .47em;
  font-weight: 620;
  letter-spacing: .04em;
  vertical-align: .32em;
}

.view-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.view-actions,
.approval-actions,
.rejection-form > div {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: .58;
}

.button-primary {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #031526;
  box-shadow: 0 8px 24px rgb(24 180 224 / 16%);
}

.button-primary:hover:not(:disabled) {
  background: #69e4fa;
}

.button-quiet {
  border-color: var(--line);
  background: rgb(10 31 60 / 72%);
  color: var(--muted);
}

.button-quiet:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.button-danger {
  border-color: rgb(255 111 121 / 48%);
  background: rgb(255 111 121 / 8%);
  color: var(--danger-soft);
}

.button-danger:hover:not(:disabled) {
  border-color: var(--danger);
  background: rgb(255 111 121 / 14%);
}

.source-strip {
  display: flex;
  min-height: 62px;
  padding: 0 20px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(7 25 51 / 70%);
  box-shadow: 0 10px 32px rgb(0 7 22 / 12%);
}

.source-strip > div {
  display: flex;
  min-width: 0;
  gap: 11px;
  align-items: center;
}

.source-strip > div:first-child {
  flex: 1 1 auto;
}

.source-label {
  flex: 0 0 auto;
  color: var(--muted-quiet);
  font-size: 11px;
  font-weight: 680;
}

.source-strip strong {
  overflow: hidden;
  color: #dbe9fb;
  font-size: 12px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-divider {
  width: 1px;
  height: 22px;
  margin: 0 22px;
  background: var(--line);
}

.assessment-panel {
  margin-top: 16px;
}

.assessment-header {
  min-height: 46px;
}

.assessment-summary {
  display: flex;
  gap: 10px;
  align-items: center;
}

.assessment-progress {
  color: var(--cyan-soft);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .04em;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.module-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-areas:
    "index copy status"
    "index result result";
  min-width: 0;
  min-height: 76px;
  padding: 11px 12px;
  gap: 5px 10px;
  align-items: center;
  border: 1px solid rgb(43 75 106 / 68%);
  border-radius: 9px;
  background: rgb(5 20 43 / 48%);
  color: var(--muted);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.module-card:not(:disabled) {
  cursor: pointer;
}

.module-card:not(:disabled):hover {
  border-color: var(--line-strong);
  background: rgb(20 49 82 / 48%);
  transform: translateY(-1px);
}

.module-card:disabled {
  cursor: default;
  opacity: 1;
}

.module-card.is-active:disabled {
  cursor: wait;
}

.module-card.is-selected {
  border-color: rgb(53 211 241 / 58%);
  background: rgb(24 63 98 / 52%);
  box-shadow: inset 0 0 0 1px rgb(53 211 241 / 10%);
}

.module-index {
  grid-area: index;
  align-self: start;
  padding-top: 2px;
  color: var(--muted-quiet);
  font-size: 9px;
  font-weight: 760;
}

.module-copy {
  display: grid;
  grid-area: copy;
  min-width: 0;
  gap: 3px;
}

.module-copy strong {
  overflow: hidden;
  color: #dce6f3;
  font-size: 11px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-copy small,
.module-result {
  overflow: hidden;
  color: var(--muted-quiet);
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-status {
  display: inline-flex;
  grid-area: status;
  gap: 5px;
  align-items: center;
  justify-self: end;
  color: var(--muted-quiet);
  font-size: 9px;
  font-weight: 720;
  white-space: nowrap;
}

.module-status::before {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid currentcolor;
  border-radius: 50%;
  content: "—";
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
}

.module-result {
  grid-area: result;
}

.module-card.is-active {
  border-color: rgb(53 211 241 / 52%);
  background: rgb(53 211 241 / 7%);
}

.module-card.is-active .module-index,
.module-card.is-active .module-status {
  color: var(--cyan);
}

.module-card.is-active .module-status::before {
  content: "…";
}

.module-card.is-ready .module-index,
.module-card.is-ready .module-status {
  color: var(--success);
}

.module-card.is-ready {
  border-color: rgb(143 230 76 / 28%);
  background: rgb(143 230 76 / 4%);
}

.module-card.is-ready .module-status::before {
  content: "✓";
}

.module-card.is-attention {
  border-color: rgb(255 202 92 / 35%);
  background: rgb(255 202 92 / 5%);
}

.module-card.is-attention .module-index,
.module-card.is-attention .module-status {
  color: var(--warning);
}

.module-card.is-attention .module-status::before {
  content: "!";
}

.module-card.is-blocked {
  border-color: rgb(255 111 121 / 38%);
  background: rgb(255 111 121 / 5%);
}

.module-card.is-blocked .module-index,
.module-card.is-blocked .module-status {
  color: var(--danger);
}

.module-card.is-blocked .module-status::before {
  content: "×";
}

.process-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 28px 0 24px;
  padding: 0;
  list-style: none;
}

.process-step {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 0;
  padding: 0 8px;
  color: var(--muted-quiet);
  text-align: center;
}

.process-step::before,
.process-step::after {
  position: absolute;
  top: 14px;
  z-index: -1;
  height: 1px;
  background: var(--line);
  content: "";
}

.process-step::before { right: 50%; left: 0; }
.process-step::after { right: 0; left: 50%; }
.process-step:first-child::before,
.process-step:last-child::after { display: none; }

.step-dot {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted-quiet);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.process-step strong {
  overflow: hidden;
  max-width: 100%;
  color: #c6d2e2;
  font-size: 12px;
  font-weight: 670;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-step small {
  font-size: 10px;
  white-space: nowrap;
}

.process-step.is-active .step-dot {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #052038;
  box-shadow: 0 0 0 5px rgb(53 211 241 / 10%), 0 0 20px rgb(53 211 241 / 28%);
}

.process-step.is-active strong,
.process-step.is-active small {
  color: var(--cyan-soft);
}

.process-step.is-done .step-dot {
  border-color: var(--success);
  background: rgb(143 230 76 / 11%);
  color: var(--success);
}

.process-step.is-done::before,
.process-step.is-done::after {
  background: rgb(143 230 76 / 42%);
}

.process-step.is-done strong { color: #d4e7c2; }
.process-step.is-done small { color: var(--success); }

.process-step.is-failed .step-dot {
  border-color: var(--danger);
  background: rgb(255 111 121 / 9%);
  color: var(--danger);
}

.process-step.is-failed strong,
.process-step.is-failed small { color: var(--danger-soft); }

.process-step.is-pending .step-dot {
  border-color: var(--warning);
  background: rgb(255 202 92 / 9%);
  color: var(--warning);
}

.process-step.is-pending strong,
.process-step.is-pending small { color: var(--warning); }

.process-step.is-skipped .step-dot {
  border-style: dashed;
  color: var(--muted);
}

.process-grid,
.library-layout,
.approval-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.process-grid {
  grid-template-columns: minmax(320px, .92fr) minmax(420px, 1.08fr);
}

.library-layout,
.approval-layout {
  grid-template-columns: minmax(280px, .72fr) minmax(500px, 1.28fr);
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgb(10 29 56 / 96%), rgb(7 24 48 / 96%));
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  min-height: 51px;
  padding: 0 17px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgb(14 36 67 / 38%);
}

.panel-header h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .02em;
}

.panel-meta {
  color: var(--muted-quiet);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.code-comparison-panel {
  margin-top: 16px;
}

.code-comparison-panel > .panel-header {
  gap: 14px;
}

.code-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  padding: 16px;
  gap: 14px;
}

.code-version-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(47 79 111 / 76%);
  border-radius: 10px;
  background: rgb(4 17 37 / 52%);
}

.code-version-card.is-result {
  transition: border-color 160ms ease, background 160ms ease;
}

.code-comparison-panel[data-artifact-stage="candidate"] .code-version-card.is-result {
  border-color: rgb(255 202 92 / 42%);
  background: rgb(255 202 92 / 3%);
}

.code-comparison-panel[data-artifact-stage="applied"] .code-version-card.is-result {
  border-color: rgb(53 211 241 / 40%);
  background: rgb(53 211 241 / 3%);
}

.code-comparison-panel[data-artifact-stage="verified"] .code-version-card.is-result {
  border-color: rgb(143 230 76 / 42%);
  background: rgb(143 230 76 / 3%);
}

.code-version-header {
  display: flex;
  min-width: 0;
  min-height: 52px;
  padding: 10px 12px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgb(47 79 111 / 66%);
  background: rgb(14 38 68 / 56%);
}

.code-version-marker {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 49px;
  min-height: 23px;
  padding: 0 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
}

.code-version-card.is-result .code-version-marker {
  border-color: rgb(53 211 241 / 36%);
  color: var(--cyan);
}

.code-comparison-panel[data-artifact-stage="candidate"] .code-version-card.is-result .code-version-marker {
  border-color: rgb(255 202 92 / 46%);
  color: var(--warning);
}

.code-comparison-panel[data-artifact-stage="verified"] .code-version-card.is-result .code-version-marker {
  border-color: rgb(143 230 76 / 46%);
  color: var(--success);
}

.code-version-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.code-version-copy strong,
.code-version-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-version-copy strong {
  color: #e6edf7;
  font-size: 11px;
  font-weight: 720;
}

.code-version-copy small {
  color: var(--muted-quiet);
  font-size: 9px;
}

.code-version-body {
  min-width: 0;
  padding: 12px;
}

.code-version-body .source-meta,
.code-version-body .code-list {
  width: 100%;
  max-width: 100%;
}

.code-product-placeholder {
  display: grid;
  min-width: 0;
  min-height: 176px;
  padding: 24px;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted-quiet);
  text-align: center;
}

.code-placeholder-mark {
  display: grid;
  width: 31px;
  height: 31px;
  margin-bottom: 2px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 13px;
}

.code-product-placeholder strong {
  color: #cbd7e8;
  font-size: 12px;
}

.code-product-placeholder > span:last-child {
  max-width: 310px;
  font-size: 10px;
  line-height: 1.65;
}

#migrated-code .code-line.is-highlighted {
  box-shadow: inset 2px 0 var(--success);
  background: rgb(143 230 76 / 8%);
  color: #c9efa7;
}

#migrated-code .code-line.is-highlighted .line-number::after {
  color: var(--success);
  content: "+";
}

.event-panel,
.detail-panel {
  min-height: 410px;
}

.event-list {
  max-height: 470px;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: var(--line-strong) transparent;
}

.empty-state {
  display: grid;
  min-height: 330px;
  padding: 28px;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: #cbd7e8;
  font-size: 14px;
}

.empty-state span,
.empty-state p {
  max-width: 390px;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.event-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 67px;
  padding: 10px 10px;
  gap: 11px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.event-row:hover {
  background: rgb(17 43 79 / 48%);
}

.event-row.is-selected {
  border-color: rgb(53 211 241 / 30%);
  background: rgb(30 77 115 / 34%);
}

.event-marker {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
}

.event-row.is-success .event-marker { border-color: rgb(143 230 76 / 54%); color: var(--success); }
.event-row.is-danger .event-marker { border-color: rgb(255 111 121 / 54%); color: var(--danger); }
.event-row.is-pending .event-marker { border-color: rgb(255 202 92 / 54%); color: var(--warning); }
.event-row.is-warning .event-marker { border-color: rgb(255 202 92 / 54%); color: var(--warning); }
.event-row.is-active .event-marker { border-color: rgb(53 211 241 / 54%); color: var(--cyan); }

.event-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.event-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 670;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-row time {
  align-self: start;
  padding-top: 4px;
  color: var(--muted-quiet);
  font-size: 9px;
}

.detail-content,
.record-detail-content,
.approval-content {
  padding: 26px;
}

.detail-kicker {
  margin: 0 0 11px;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.detail-content h3,
.record-heading h3 {
  margin: 0;
  color: #f5f8ff;
  font-size: clamp(17px, 1.45vw, 21px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.42;
}

.detail-summary {
  max-width: 700px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.status-badge,
.mini-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid currentcolor;
  border-radius: 999px;
  font-weight: 720;
  line-height: 1;
}

.status-badge {
  min-height: 25px;
  padding: 0 9px;
  font-size: 9px;
}

.mini-status {
  padding: 3px 6px;
  font-size: 9px;
}

.status-badge.is-neutral { color: var(--muted); }
.status-badge.is-active,
.status-badge.is-info { color: var(--cyan); }
.status-badge.is-success,
.mini-status.is-approved { color: var(--success); }
.status-badge.is-danger,
.mini-status.is-rejected { color: var(--danger); }
.status-badge.is-pending,
.mini-status.is-pending { color: var(--warning); }

.error-block,
.evidence-block {
  margin: 20px 0 0;
  border-radius: 8px;
  font-family: var(--font-mono);
}

.error-block {
  display: grid;
  gap: 7px;
  padding: 13px 15px;
  border: 1px solid rgb(255 111 121 / 28%);
  background: rgb(255 111 121 / 7%);
}

.error-block span {
  color: var(--danger);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}

.error-block code {
  overflow-wrap: anywhere;
  color: var(--danger-soft);
  font-size: 11px;
  line-height: 1.55;
}

.evidence-block {
  min-height: 82px;
  padding: 14px 15px;
  overflow: auto;
  border: 1px solid rgb(94 137 179 / 34%);
  background: rgb(2 13 31 / 66%);
  color: #b9cce2;
  font-size: 10px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.next-step {
  display: flex;
  margin-top: 22px;
  padding-top: 16px;
  gap: 11px;
  align-items: baseline;
  border-top: 1px solid rgb(54 83 113 / 58%);
}

.next-step span {
  flex: 0 0 auto;
  color: var(--muted-quiet);
  font-size: 10px;
}

.next-step strong {
  color: #dbe7f7;
  font-size: 11px;
  font-weight: 630;
}

.validation-strip {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr) 1px minmax(230px, .8fr);
  min-height: 68px;
  margin-top: 16px;
  padding: 10px 18px;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(7 24 48 / 80%);
}

.validation-gate {
  display: flex;
  gap: 11px;
  align-items: center;
}

.gate-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid currentcolor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
}

.validation-gate > div {
  display: grid;
  gap: 3px;
}

.validation-gate span:not(.gate-icon) {
  color: var(--muted-quiet);
  font-size: 9px;
}

.validation-gate strong {
  font-size: 11px;
  font-weight: 700;
}

.validation-gate.is-idle { color: var(--muted-quiet); }
.validation-gate.is-running { color: var(--cyan); }
.validation-gate.is-failed { color: var(--danger); }
.validation-gate.is-passed { color: var(--success); }

.validation-plus {
  color: var(--line-strong);
  font-family: var(--font-mono);
  font-size: 17px;
}

.validation-divider {
  width: 1px;
  height: 32px;
  background: var(--line);
}

.validation-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.record-count {
  display: flex;
  min-width: 130px;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.record-count strong {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 26px;
}

.record-count span {
  color: var(--muted);
  font-size: 11px;
}

.record-list-panel,
.record-detail-panel,
.approval-review,
.approval-placeholder {
  min-height: 525px;
}

.record-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.record-item {
  display: grid;
  width: 100%;
  min-height: 91px;
  padding: 13px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.record-item:hover,
.record-item.is-selected {
  border-color: rgb(53 211 241 / 26%);
  background: rgb(26 64 99 / 34%);
}

.record-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.record-item-heading > .mono {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .04em;
}

.record-item > strong {
  color: #e6eef9;
  font-size: 12px;
  font-weight: 670;
}

.record-item > small {
  overflow: hidden;
  color: var(--muted-quiet);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 25px;
}

.record-heading .detail-kicker {
  margin-bottom: 9px;
}

.version-label {
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.detail-rows {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.detail-rows > div {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  min-height: 61px;
  padding: 14px 0;
  align-items: start;
  border-bottom: 1px solid rgb(37 66 95 / 66%);
}

.detail-rows dt {
  color: var(--muted-quiet);
  font-size: 10px;
}

.detail-rows dd {
  margin: 0;
  color: #d5e0ed;
  font-size: 11px;
  line-height: 1.62;
}

.evidence-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.evidence-pass {
  display: flex;
  min-height: 50px;
  padding: 10px 12px;
  gap: 9px;
  align-items: center;
  border: 1px solid rgb(143 230 76 / 22%);
  border-radius: 8px;
  background: rgb(143 230 76 / 6%);
}

.evidence-pass span {
  color: var(--success);
  font-family: var(--font-mono);
  font-weight: 900;
}

.evidence-pass strong {
  color: #d9edc7;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
}

.approval-empty {
  min-height: 360px;
}

.approval-placeholder {
  display: grid;
  min-height: 525px;
  padding: 40px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.approval-placeholder strong {
  color: #d8e2ef;
  font-size: 15px;
}

.approval-placeholder p {
  max-width: 430px;
  margin: 9px 0 21px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.note-field,
.rejection-form {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.note-field > span,
.rejection-form > label {
  color: #c9d6e6;
  font-size: 10px;
  font-weight: 650;
}

.note-field small {
  color: var(--muted-quiet);
  font-weight: 500;
}

.note-field input,
.rejection-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(3 16 36 / 68%);
  color: var(--text);
  font-size: 12px;
}

.note-field input {
  min-height: 42px;
  padding: 0 12px;
}

.rejection-form textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
}

.note-field input::placeholder,
.rejection-form textarea::placeholder {
  color: #60738e;
}

.note-field input:hover,
.rejection-form textarea:hover {
  border-color: var(--line-strong);
}

.approval-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.rejection-form {
  padding: 15px;
  border: 1px solid rgb(255 111 121 / 26%);
  border-radius: 9px;
  background: rgb(255 111 121 / 5%);
}

.field-error {
  margin: -2px 0 0;
  color: var(--danger-soft);
  font-size: 10px;
}

.decision-record {
  display: grid;
  gap: 5px;
  margin-top: 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgb(8 27 53 / 66%);
}

.decision-record span {
  color: var(--muted-quiet);
  font-size: 9px;
}

.decision-record strong {
  color: #dfe9f6;
  font-size: 12px;
}

.decision-record small {
  color: var(--muted);
  font-size: 9px;
}

.technical-evidence {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.inspection-section,
.record-inspection-shell {
  overflow: hidden;
  border: 1px solid rgb(48 83 116 / 78%);
  border-radius: 9px;
  background: rgb(4 17 37 / 48%);
}

.inspection-section > summary,
.record-inspection-shell > summary {
  position: relative;
  display: flex;
  min-height: 52px;
  padding: 10px 13px;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.inspection-section > summary::-webkit-details-marker,
.record-inspection-shell > summary::-webkit-details-marker {
  display: none;
}

.inspection-section > summary:hover,
.record-inspection-shell > summary:hover {
  background: rgb(22 55 88 / 36%);
}

.inspection-section > summary:focus-visible,
.record-inspection-shell > summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -3px;
}

.inspection-section[open] > summary,
.record-inspection-shell[open] > summary {
  border-bottom: 1px solid rgb(48 83 116 / 72%);
  background: rgb(18 49 82 / 34%);
}

.inspection-section > summary > span:first-child,
.record-inspection-shell > summary > span:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.inspection-section > summary strong,
.record-inspection-shell > summary > span {
  color: #dce7f4;
  font-size: 11px;
  font-weight: 700;
}

.inspection-section > summary small,
.record-inspection-shell > summary small {
  color: var(--muted-quiet);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.45;
}

.summary-action {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
}

.inspection-section[open] .summary-action {
  border-color: rgb(53 211 241 / 42%);
  color: var(--cyan);
}

.inspection-section[open] .summary-action::before {
  content: "收起";
}

.inspection-section[open] .summary-action {
  font-size: 0;
}

.inspection-section[open] .summary-action::before {
  font-size: 9px;
}

.inspection-body,
.record-inspection {
  min-width: 0;
}

.inspection-body {
  padding: 15px;
}

.record-inspection-shell {
  margin-top: 20px;
}

.record-inspection-shell > summary {
  min-height: 58px;
}

.record-inspection-shell > summary > small {
  margin-left: auto;
  text-align: right;
}

.record-inspection-shell > summary::after {
  flex: 0 0 auto;
  color: var(--cyan);
  content: "+";
  font-family: var(--font-mono);
  font-size: 14px;
}

.record-inspection-shell[open] > summary::after {
  content: "−";
}

.record-inspection {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.record-inspection > .inspection-section > summary {
  min-height: 48px;
}

.inspection-fields,
.module-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inspection-field {
  display: grid;
  min-width: 0;
  min-height: 58px;
  padding: 10px 11px;
  gap: 5px;
  align-content: center;
  border: 1px solid rgb(43 75 106 / 65%);
  border-radius: 7px;
  background: rgb(10 31 58 / 54%);
}

.inspection-field > span {
  color: var(--muted-quiet);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .03em;
}

.inspection-field > strong {
  overflow-wrap: anywhere;
  color: #dce7f3;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 590;
  line-height: 1.55;
}

.inspection-explanation,
.inspection-boundary,
.inspection-validation {
  margin: 11px 0 0;
  padding: 11px 12px;
  border-left: 2px solid var(--cyan);
  border-radius: 0 7px 7px 0;
  background: rgb(53 211 241 / 6%);
  color: #b9cada;
  font-size: 10px;
  line-height: 1.7;
}

.inspection-boundary {
  border-left-color: var(--warning);
  background: rgb(255 202 92 / 5%);
}

.inspection-validation {
  border-left-color: var(--success);
  background: rgb(143 230 76 / 5%);
}

.callout-label {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
}

.inspection-boundary .callout-label { color: var(--warning); }
.inspection-validation .callout-label { color: var(--success); }

.inspection-label {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.source-meta {
  display: flex;
  min-height: 34px;
  padding: 0 10px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgb(47 79 111 / 74%);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: rgb(14 38 68 / 82%);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.source-meta strong {
  color: #d9e6f5;
  font-weight: 600;
}

.code-list,
.diff-list {
  display: grid;
  max-width: 100%;
  margin: 0;
  padding: 8px 0;
  overflow-x: auto;
  border: 1px solid rgb(47 79 111 / 74%);
  border-radius: 0 0 7px 7px;
  background: #031126;
  font-family: var(--font-mono);
  scrollbar-color: var(--line-strong) transparent;
}

.code-line,
.diff-line {
  display: grid;
  grid-template-columns: 40px max-content;
  min-width: 100%;
  min-height: 25px;
  align-items: center;
  color: #b9cce1;
  font-size: 9px;
  line-height: 1.5;
  white-space: pre;
}

.line-number {
  align-self: stretch;
  display: grid;
  padding: 4px 9px 4px 0;
  place-items: center end;
  border-right: 1px solid rgb(45 73 103 / 68%);
  color: #5f7590;
  user-select: none;
}

.line-code {
  display: block;
  min-width: max-content;
  padding: 4px 12px;
}

.code-line.is-highlighted {
  box-shadow: inset 2px 0 var(--danger);
  background: rgb(255 111 121 / 10%);
  color: #ffd4d7;
}

.code-line.is-highlighted .line-number::after {
  margin-left: 4px;
  color: var(--danger);
  content: "!";
  font-size: 8px;
}

.diff-line.is-addition {
  background: rgb(143 230 76 / 8%);
  color: #c9efa7;
}

.diff-line.is-deletion {
  background: rgb(255 111 121 / 8%);
  color: #ffc1c5;
}

.diff-line.is-hunk {
  background: rgb(53 211 241 / 7%);
  color: var(--cyan-soft);
}

.match-evidence,
.match-list,
.module-checks {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.match-row,
.match-item,
.module-check {
  display: grid;
  grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr) auto;
  min-height: 41px;
  padding: 8px 10px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgb(43 75 106 / 65%);
  border-radius: 7px;
  color: var(--muted);
  font-size: 9px;
}

.match-row strong,
.match-item strong,
.module-check strong {
  overflow-wrap: anywhere;
  color: #dce7f3;
  font-family: var(--font-mono);
  font-size: 9px;
}

.module-check > span:first-child {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.match-state,
.inspection-status {
  justify-self: end;
  color: var(--success);
  font-size: 8px;
  font-weight: 760;
  white-space: nowrap;
}

.match-state.is-unmatched,
.inspection-status.is-unmatched { color: var(--danger); }
.match-state.is-pending,
.inspection-status.is-pending { color: var(--warning); }
.inspection-status.is-ready { color: var(--success); }
.inspection-status.is-attention { color: var(--warning); }
.inspection-status.is-blocked { color: var(--danger); }

.diff-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.diff-meta-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgb(43 75 106 / 65%);
  border-radius: 7px;
}

.diff-meta-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-quiet);
  font-size: 8px;
}

.diff-meta-grid strong {
  color: #d6e1ee;
  font-size: 9px;
  font-weight: 580;
  line-height: 1.6;
}

.inspection-truncation {
  margin: 0;
  padding: 8px 12px;
  color: var(--warning);
  font-size: 9px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #10294a;
  box-shadow: 0 18px 50px rgb(0 4 14 / 42%);
  color: #eaf2fc;
  font-size: 11px;
  line-height: 1.55;
  animation: toast-in 180ms ease-out both;
}

.toast.is-success { border-color: rgb(143 230 76 / 46%); }
.toast.is-warning { border-color: rgb(255 202 92 / 46%); }
.toast.is-info { border-color: rgb(53 211 241 / 46%); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .view-tabs {
    grid-row: 2;
    grid-column: 1 / -1;
    min-height: 45px;
    border-top: 1px solid rgb(37 66 95 / 55%);
  }

  .brand,
  .demo-status {
    min-height: 61px;
  }

  .source-divider {
    margin-right: 14px;
    margin-left: 14px;
  }

  .process-grid,
  .library-layout,
  .approval-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .event-panel,
  .detail-panel {
    min-height: 350px;
  }

  .event-list {
    max-height: 380px;
  }

  .record-list-panel,
  .record-detail-panel,
  .approval-review,
  .approval-placeholder {
    min-height: auto;
  }

  .approval-placeholder {
    min-height: 320px;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .app-shell {
    width: min(100% - 28px, 1450px);
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-name {
    font-size: 15px;
  }

  .demo-status span:last-child {
    display: none;
  }

  .demo-status::after {
    color: var(--muted);
    content: "演示";
    font-size: 11px;
  }

  .view-tabs {
    gap: 0;
    justify-content: stretch;
  }

  .view-tab {
    flex: 1 1 0;
    justify-content: center;
    font-size: 12px;
  }

  .app-shell {
    padding: 27px 0 52px;
  }

  .view-header {
    flex-direction: column;
    gap: 16px;
  }

  .view-actions {
    width: 100%;
  }

  .view-actions .button {
    flex: 1 1 0;
  }

  .source-strip {
    display: grid;
    padding: 10px 14px;
    gap: 0;
  }

  .source-strip > div {
    min-height: 42px;
    justify-content: space-between;
  }

  .source-divider {
    width: 100%;
    height: 1px;
    margin: 0;
  }

  .source-strip strong {
    max-width: 68%;
    text-align: right;
  }

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

  .process-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 18px;
  }

  .process-step:nth-child(3)::after,
  .process-step:nth-child(4)::before {
    display: none;
  }

  .event-panel,
  .detail-panel {
    min-height: 330px;
  }

  .event-list {
    max-height: 360px;
  }

  .detail-content,
  .record-detail-content,
  .approval-content {
    padding: 21px;
  }

  .record-inspection-shell > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .record-inspection-shell > summary > small {
    margin-left: 0;
    text-align: left;
  }

  .record-inspection-shell > summary::after {
    position: absolute;
    right: 16px;
  }

  .code-comparison-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 13px;
  }

  .code-product-placeholder {
    min-height: 142px;
  }

  .validation-strip {
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
  }

  .validation-divider {
    display: none;
  }

  .validation-strip p {
    grid-column: 1 / -1;
    padding-top: 9px;
    border-top: 1px solid var(--line);
    text-align: center;
  }
}

@media (max-width: 460px) {
  .header-inner,
  .app-shell {
    width: min(100% - 22px, 1450px);
  }

  .brand-name {
    max-width: 145px;
  }

  .demo-label {
    display: none;
  }

  .view-tab {
    font-size: 11px;
  }

  .app-shell {
    padding-top: 22px;
  }

  .view-header h1 .mono {
    display: block;
    margin: 6px 0 0;
    font-size: 11px;
    vertical-align: initial;
  }

  .process-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 17px;
  }

  .assessment-header {
    gap: 10px;
  }

  .assessment-summary {
    gap: 7px;
  }

  .module-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }

  .process-step:nth-child(3)::after,
  .process-step:nth-child(4)::before {
    display: block;
  }

  .process-step:nth-child(even)::after,
  .process-step:nth-child(odd)::before {
    display: none;
  }

  .event-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .event-row time {
    display: none;
  }

  .detail-rows > div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .inspection-fields,
  .module-detail-fields,
  .diff-meta-grid {
    grid-template-columns: 1fr;
  }

  .inspection-section > summary {
    min-height: 58px;
  }

  .match-row,
  .match-item,
  .module-check {
    grid-template-columns: 1fr auto;
  }

  .match-row > :nth-child(2),
  .match-item > :nth-child(2),
  .module-check > :nth-child(2) {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .evidence-pair {
    grid-template-columns: 1fr;
  }

  .validation-strip {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .validation-plus,
  .validation-divider {
    display: none;
  }

  .validation-gate {
    min-height: 44px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .approval-actions,
  .rejection-form > div {
    align-items: stretch;
    flex-direction: column;
  }

  .approval-actions .button,
  .rejection-form .button {
    width: 100%;
  }

  .toast {
    right: 11px;
    bottom: 11px;
    left: 11px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
