:root {
  --graphite: #111417;
  --steel: #162129;
  --steel-soft: #1c2a33;
  --grid: #2a3943;
  --cyan: #55c7d9;
  --cyan-soft: rgba(85, 199, 217, 0.13);
  --amber: #f4b942;
  --amber-soft: rgba(244, 185, 66, 0.14);
  --danger: #ff5d52;
  --danger-soft: rgba(255, 93, 82, 0.15);
  --paper: #eaf0f2;
  --muted: #91a2ab;
  --line: rgba(145, 162, 171, 0.22);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--graphite);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% -12%, rgba(85, 199, 217, 0.13), transparent 34rem),
    linear-gradient(145deg, #101417 0%, #131a1f 48%, #0d1114 100%);
  color: var(--paper);
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(85, 199, 217, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 199, 217, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 12px clamp(18px, 3vw, 46px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 18, 0.82);
  backdrop-filter: blur(18px);
}

.brand-lockup,
.system-strip,
.system-item,
.result-heading-row,
.example-heading,
.section-title,
.actions {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 16px;
}

.brand-mark {
  width: 58px;
  height: 46px;
  display: grid;
  place-content: center;
  border: 1px solid rgba(85, 199, 217, 0.52);
  background: var(--cyan-soft);
  color: var(--cyan);
  font-family: Bahnschrift, "Arial Narrow", sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1;
  text-align: center;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.brand-mark strong {
  display: block;
  margin-top: 3px;
  color: var(--paper);
  font-size: 19px;
  letter-spacing: 0.08em;
}

.eyebrow,
.panel-index,
.micro-label,
.system-item span,
.status-kicker,
.section-title em,
.footer-strip,
.metric span {
  font-family: Bahnschrift, "Arial Narrow", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 9px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(17px, 1.7vw, 24px);
  font-weight: 650;
  letter-spacing: 0.04em;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 620;
}

.system-strip {
  gap: 0;
  border: 1px solid var(--line);
}

.system-item {
  min-width: 124px;
  gap: 8px;
  justify-content: space-between;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
  background: rgba(22, 33, 41, 0.6);
}

.system-item:last-child {
  border-right: 0;
}

.system-item span {
  color: var(--muted);
  font-size: 8px;
}

.system-item strong {
  color: var(--cyan);
  font-family: Bahnschrift, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.pulse {
  min-width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(85, 199, 217, 0.11);
  animation: pulse 2.4s ease-in-out infinite;
}

.console-grid {
  width: min(1540px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 0;
  padding: 24px clamp(18px, 3vw, 46px) 30px;
}

.input-panel,
.result-panel {
  min-height: calc(100vh - 132px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.input-panel {
  position: relative;
  z-index: 2;
  padding: 22px 24px;
  background: linear-gradient(180deg, rgba(28, 42, 51, 0.96), rgba(17, 25, 30, 0.97));
}

.result-panel {
  padding: 26px 28px 32px;
  border-left: 0;
  background: rgba(13, 18, 22, 0.89);
}

.panel-index {
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 10px;
}

.panel-copy {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
}

.textarea-shell {
  position: relative;
}

textarea {
  width: 100%;
  height: 158px;
  min-height: 138px;
  resize: vertical;
  border: 1px solid var(--grid);
  border-radius: 0;
  outline: 0;
  padding: 16px 16px 34px;
  background: rgba(6, 10, 12, 0.72);
  color: var(--paper);
  line-height: 1.65;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea::placeholder {
  color: #64747d;
}

textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(85, 199, 217, 0.11);
}

.character-count {
  position: absolute;
  right: 11px;
  bottom: 10px;
  color: #6f818b;
  font-family: Bahnschrift, monospace;
  font-size: 10px;
}

.example-block {
  margin-top: 16px;
}

.example-heading {
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
}

.micro-label {
  color: var(--muted);
  font-size: 8px;
}

.example-list {
  display: grid;
  gap: 5px;
}

.example-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--grid);
  padding: 8px 11px;
  background: rgba(10, 15, 18, 0.42);
  color: #b8c5ca;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
  transition: color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.example-button:hover,
.example-button:focus-visible {
  border-color: rgba(85, 199, 217, 0.65);
  color: var(--paper);
  transform: translateX(3px);
}

.example-button code {
  color: var(--cyan);
  font-family: Bahnschrift, monospace;
}

.actions {
  gap: 8px;
  margin-top: 14px;
}

.primary-action,
.secondary-action,
.copy-action {
  min-height: 38px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
  font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.primary-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cyan);
  color: #091216;
}

.primary-action:hover:not(:disabled) {
  background: #77d6e4;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

.secondary-action,
.copy-action {
  border-color: var(--grid);
  background: transparent;
  color: var(--muted);
}

.secondary-action:hover,
.copy-action:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--paper);
}

.copy-action:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.safety-note {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #83949d;
  font-size: 10px;
  line-height: 1.6;
}

.safety-note span {
  margin-right: 6px;
  color: var(--amber);
}

.result-heading-row {
  justify-content: space-between;
  gap: 20px;
}

.status-banner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--grid);
  border-left-width: 5px;
  background: rgba(22, 33, 41, 0.64);
}

.status-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
}

.status-banner strong {
  font-size: 18px;
}

.status-code {
  font-family: Bahnschrift, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.status-idle {
  border-left-color: var(--grid);
}

.status-actionable {
  border-color: rgba(85, 199, 217, 0.46);
  border-left-color: var(--cyan);
  background: var(--cyan-soft);
}

.status-actionable .status-code,
.status-actionable .status-kicker {
  color: var(--cyan);
}

.status-needs_more_info {
  border-color: rgba(244, 185, 66, 0.46);
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.status-needs_more_info .status-code,
.status-needs_more_info .status-kicker {
  color: var(--amber);
}

.status-stop_and_escalate,
.status-error {
  border-color: rgba(255, 93, 82, 0.5);
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.status-stop_and_escalate .status-code,
.status-stop_and_escalate .status-kicker,
.status-error .status-code,
.status-error .status-kicker {
  color: var(--danger);
}

.fault-summary {
  margin: 14px 0;
  color: #c3cdd1;
  font-size: 12px;
  line-height: 1.65;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.metric {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: var(--muted);
  font-size: 8px;
}

.metric strong {
  color: var(--cyan);
  font-family: Bahnschrift, monospace;
  font-size: 15px;
}

.result-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 12px;
  margin-top: 12px;
}

.result-stack {
  display: grid;
  align-content: start;
  gap: 12px;
}

.result-card,
.evidence-section {
  border: 1px solid var(--line);
  background: rgba(18, 27, 33, 0.66);
}

.result-card {
  padding: 14px;
}

.section-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 650;
}

.section-title em {
  color: var(--muted);
  font-size: 7px;
  font-style: normal;
}

.data-list,
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.data-list li {
  padding: 7px 0;
  border-bottom: 1px dashed rgba(145, 162, 171, 0.15);
  color: #b9c5ca;
  font-size: 11px;
  line-height: 1.55;
}

.data-list li:last-child {
  border-bottom: 0;
}

.fact-label {
  display: inline-block;
  min-width: 74px;
  color: var(--cyan);
  font-family: Bahnschrift, sans-serif;
}

.cause-list {
  display: grid;
  gap: 8px;
}

.cause-item {
  position: relative;
  padding: 9px 10px 9px 13px;
  border-left: 2px solid var(--cyan);
  background: rgba(5, 9, 11, 0.34);
}

.cause-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cause-name {
  font-size: 11px;
  font-weight: 650;
}

.evidence-level {
  color: var(--cyan);
  font-family: Bahnschrift, monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.cause-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.evidence-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.evidence-chip {
  border: 1px solid var(--grid);
  padding: 2px 5px;
  color: #a8bac2;
  font-family: Bahnschrift, monospace;
  font-size: 8px;
}

.timeline {
  counter-reset: sequence;
}

.timeline li {
  position: relative;
  min-height: 42px;
  padding: 5px 0 10px 35px;
  counter-increment: sequence;
}

.timeline li::before {
  content: counter(sequence, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 3px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: Bahnschrift, monospace;
  font-size: 8px;
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 28px;
  bottom: -2px;
  width: 1px;
  background: var(--grid);
}

.timeline li:last-child::after {
  display: none;
}

.step-action {
  color: #c7d1d5;
  font-size: 10px;
  line-height: 1.45;
}

.step-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.evidence-section {
  margin-top: 12px;
  padding: 14px;
}

.evidence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.evidence-item {
  border: 1px solid var(--line);
  background: rgba(7, 12, 14, 0.35);
}

.evidence-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
  color: #c5d0d4;
  font-size: 10px;
}

.evidence-item summary::-webkit-details-marker {
  display: none;
}

.evidence-id {
  color: var(--cyan);
  font-family: Bahnschrift, monospace;
}

.evidence-body {
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.empty-list {
  color: #62747d;
  font-size: 10px;
}

.result-populated .result-card,
.result-populated .evidence-section {
  animation: reveal 280ms ease both;
}

.result-populated .result-stack:nth-child(2) .result-card {
  animation-delay: 60ms;
}

.result-populated .evidence-section {
  animation-delay: 110ms;
}

.footer-strip {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px clamp(18px, 3vw, 46px);
  border-top: 1px solid var(--line);
  color: #60727b;
  font-size: 8px;
}

@keyframes pulse {
  50% {
    opacity: 0.42;
    box-shadow: 0 0 0 7px rgba(85, 199, 217, 0.04);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .clock-item {
    display: none;
  }

  .system-item {
    min-width: 112px;
  }

  .console-grid {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .result-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar,
  .footer-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .system-strip {
    width: 100%;
  }

  .system-item {
    flex: 1;
  }

  .console-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .input-panel,
  .result-panel {
    min-height: auto;
  }

  .result-panel {
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .system-strip,
  .metric-row,
  .evidence-list {
    grid-template-columns: 1fr;
  }

  .system-strip {
    display: grid;
  }

  .system-item,
  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .system-item:last-child,
  .metric:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
