:root {
  --bg: #0c1117;
  --surface: #121a23;
  --line: #26313d;
  --text: #e7e9ed;
  --muted: #8391a2;
  --gold: #dfbd80;
  --green: #6fc7a8;
  --red: #ec9090;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.6 "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button,
a,
input,
textarea {
  outline-offset: 4px;
}
button {
  border: 0;
  color: inherit;
  background: none;
}
a {
  color: var(--gold);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.7px;
}
h2 {
  font-size: 16px;
  font-weight: 500;
}
h3 {
  font-size: 20px;
  font-weight: 500;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font:
    11px/1.6 Consolas,
    monospace;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 10px;
}
.wordmark {
  font-size: 27px;
  letter-spacing: 3px;
  font-weight: 600;
}
.wordmark span {
  display: block;
  font:
    9px/1.5 Consolas,
    monospace;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 5px;
}
.primary {
  background: var(--gold);
  color: #171b20;
  padding: 11px 20px;
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}
.primary:hover {
  background: #edcc95;
}
.secondary {
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 3px;
}
.quiet {
  color: var(--muted);
  padding: 6px 10px;
}
.quiet:hover {
  color: var(--text);
}
.sidebar {
  width: 214px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--line);
  padding: 29px 22px;
  display: flex;
  flex-direction: column;
}
.nav-label {
  font-size: 11px;
  color: var(--muted);
  margin: 50px 0 15px 11px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 12px 11px;
  margin-bottom: 5px;
  color: var(--muted);
  border-radius: 3px;
}
.nav > span:first-child {
  font-size: 18px;
  width: 18px;
  text-align: center;
}
.nav.active {
  color: var(--gold);
  background: #dfbd8010;
  box-shadow: inset 2px 0 var(--gold);
}
.nav:hover {
  background: #ffffff05;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.sidebar-footer button {
  margin-left: auto;
}
.status-dot,
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
main {
  margin-left: 214px;
}
.topbar {
  height: 68px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.topbar > div:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page {
  max-width: 1600px;
  margin: auto;
  padding: 34px 38px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.page-heading .muted {
  margin-top: 12px;
}
.notice {
  border: 1px solid #dfbd8033;
  background: #dfbd8008;
  color: #d7bd98;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 13px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  margin-bottom: 25px;
}
.metric {
  padding: 23px;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border: 0;
}
.metric .value {
  font:
    30px/1.6 Consolas,
    monospace;
  color: #e8e4dc;
}
.metric .label {
  font-size: 11px;
  color: var(--muted);
}
.metric .footnote {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  gap: 24px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 23px;
  min-width: 0;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}
.panel-heading .muted {
  font-size: 11px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
}
th {
  text-align: left;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  padding: 8px 12px 14px 0;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 22px 12px 22px 0;
  border-bottom: 1px solid #26313d88;
  font-size: 13px;
}
tr:last-child td {
  border: 0;
}
.symbol {
  font-weight: 600;
}
.symbol small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 1px;
}
.number {
  font-family: Consolas, monospace;
  font-size: 17px;
}
.tag {
  font:
    10px/1.6 Consolas,
    monospace;
  letter-spacing: 0.5px;
  border: 1px solid var(--line);
  padding: 3px 7px;
  color: var(--muted);
  display: inline-block;
  white-space: nowrap;
}
.good,
.approved,
.completed,
.confirmed {
  color: var(--green);
  border-color: #6fc7a844;
}
.unavailable,
.failed,
.dead,
.validation_failed,
.rejected {
  color: var(--red);
  border-color: #ec909044;
}
.degraded,
.stale,
.pending_review,
.date_only {
  color: var(--gold);
  border-color: #dfbd8044;
}
.process-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #26313d88;
}
.process-row:last-child {
  border: 0;
}
.model-note {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: 19px;
}
.model-note strong {
  display: block;
  font:
    12px/2 Consolas,
    monospace;
  font-weight: 400;
}
.sources-panel {
  margin-top: 24px;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 25px;
}
.source-item {
  padding: 13px 0;
  border-bottom: 1px solid #26313d88;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}
.row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 22px;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  align-items: start;
}
.row .time {
  font-size: 11px;
  color: var(--muted);
}
.row .description {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}
.row .title {
  font-size: 15px;
}
.empty {
  padding: 65px 24px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-sign {
  font-size: 38px;
  color: #475567;
  margin-bottom: 13px;
}
.empty h3 {
  color: #d1d8e1;
  font-size: 18px;
  margin-bottom: 10px;
}
.empty p {
  font-size: 12px;
  max-width: 450px;
  margin: auto;
}
.filter-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 22px;
}
.filter {
  padding: 7px 0;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.filter.active {
  color: var(--gold);
  border-color: var(--gold);
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.article-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 25px;
}
.article-card h3 {
  margin: 20px 0 14px;
}
.article-card .body {
  color: #b2bdcb;
  line-height: 1.9;
  white-space: pre-wrap;
}
.card-top,
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-bottom {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.card-actions {
  display: flex;
  gap: 8px;
}
.card-actions button {
  border: 1px solid var(--line);
  padding: 7px 12px;
  color: var(--gold);
  font-size: 12px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.full-width {
  grid-column: 1/-1;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 19px;
}
input,
textarea {
  display: block;
  width: 100%;
  background: #0e151d;
  border: 1px solid #33404f;
  border-radius: 3px;
  padding: 11px 12px;
  margin-top: 8px;
  color: var(--text);
}
input:focus,
textarea:focus {
  border-color: var(--gold);
}
textarea {
  font:
    12px/1.8 Consolas,
    monospace;
  resize: vertical;
}
.save-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
}
.error {
  color: var(--red);
  margin-top: 12px;
}
footer {
  margin-top: 43px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
  font:
    10px/1.5 Consolas,
    monospace;
  letter-spacing: 1px;
  color: #657486;
  display: flex;
  justify-content: space-between;
}
footer span {
  font-family: inherit;
  letter-spacing: 0;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-box {
  max-width: 420px;
  width: calc(100% - 60px);
  margin: auto;
}
.login-box .wordmark {
  margin-bottom: 75px;
}
.login-box h1 {
  font-size: 44px;
  line-height: 1.3;
  margin: 20px 0;
}
.login-box .muted {
  margin-bottom: 35px;
}
.login-box .primary {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
}
.login-box small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 45px;
}
.login-aside {
  border-left: 1px solid var(--line);
  padding: 75px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 79px,
      #ffffff03 79px,
      #ffffff03 80px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 79px,
      #ffffff03 79px,
      #ffffff03 80px
    );
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-aside p {
  font:
    clamp(30px, 4vw, 68px) / 1.25 Consolas,
    monospace;
  color: #8a9aab;
  letter-spacing: -2px;
}
.login-aside span {
  margin-top: 35px;
  color: var(--muted);
  font-size: 13px;
}
.crosshair {
  font-size: 70px;
  color: var(--gold);
  margin-bottom: 50px;
}
dialog {
  background: var(--bg);
  color: var(--text);
  border: 1px solid #455264;
  width: min(1040px, 94vw);
  max-height: 92vh;
  padding: 30px;
}
dialog::backdrop {
  background: #000b;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px;
  margin-bottom: 25px;
}
.dialog-header .eyebrow {
  margin: 0;
}
#detail h2 {
  font-size: 25px;
  margin: 15px 0;
}
#detail h3 {
  font-size: 15px;
  color: var(--gold);
  margin: 25px 0 9px;
}
#detail img {
  width: 100%;
  margin: 20px 0;
}
#detail .commentary {
  font-size: 16px;
  line-height: 2;
  color: #c1cbd6;
  white-space: pre-wrap;
}
#detail pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 400px;
  overflow: auto;
  padding: 18px;
  background: var(--surface);
  font:
    11px/1.8 Consolas,
    monospace;
}
details {
  margin: 15px 0;
  border: 1px solid var(--line);
  padding: 13px;
}
summary {
  cursor: pointer;
  color: var(--muted);
}
#toast {
  position: fixed;
  right: 30px;
  bottom: 30px;
  padding: 14px 22px;
  background: #243342;
  border: 1px solid #526578;
  z-index: 1000;
  max-width: 80vw;
}
.view[hidden],
#workspace[hidden],
#login[hidden] {
  display: none;
}
.article-grid > .empty {
  grid-column: 1/-1;
}
.evidence-button {
  color: var(--gold);
  padding: 7px 0;
  text-align: left;
  font:
    11px Consolas,
    monospace;
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .sidebar {
    width: 180px;
    padding: 25px 14px;
  }
  main {
    margin-left: 180px;
  }
  .page {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .source-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .full-width {
    grid-column: auto;
  }
  .article-grid {
    grid-template-columns: 1fr;
  }
  .login-aside {
    padding: 35px;
  }
}
@media (max-width: 700px) {
  .sidebar {
    width: 64px;
    padding: 20px 8px;
  }
  .sidebar .wordmark {
    font-size: 17px;
    letter-spacing: 0;
  }
  .sidebar .wordmark span,
  .nav-label,
  .sidebar-footer,
  .nav > span:not(:first-child) {
    display: none;
  }
  .nav {
    font-size: 0;
    padding: 12px;
    justify-content: center;
  }
  .nav > span:first-child {
    font-size: 20px;
  }
  .nav.active {
    box-shadow: inset 2px 0 var(--gold);
  }
  nav {
    margin-top: 35px;
  }
  main {
    margin-left: 64px;
  }
  .page {
    padding: 24px 16px;
  }
  .topbar {
    padding: 0 16px;
    font-size: 10px;
  }
  .topbar > div:last-child {
    gap: 5px;
  }
  #clock {
    font-size: 9px;
  }
  h1 {
    font-size: 25px;
  }
  .page-heading {
    align-items: start;
    gap: 10px;
  }
  .page-heading .primary {
    font-size: 11px;
    padding: 9px 10px;
  }
  .page-heading .muted {
    font-size: 11px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }
  .metric:nth-child(2) {
    border-right: 0;
  }
  .metric .value {
    font-size: 24px;
  }
  .panel {
    padding: 16px;
  }
  .source-grid {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .panel-heading {
    align-items: start;
  }
  .panel-heading .muted {
    max-width: 150px;
  }
  .two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .save-bar {
    align-items: start;
    gap: 12px;
  }
  .save-bar p {
    font-size: 11px;
  }
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-aside {
    display: none;
  }
  .login-box .wordmark {
    margin-bottom: 45px;
  }
  .login-box h1 {
    font-size: 36px;
  }
  footer {
    display: block;
  }
  footer span {
    display: block;
    margin-top: 10px;
  }
  .filter-bar {
    gap: 12px;
    font-size: 11px;
  }
  .card-actions {
    flex-wrap: wrap;
  }
  .card-bottom {
    align-items: start;
  }
  dialog {
    padding: 18px;
  }
  .settings-grid {
    gap: 16px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.16s,
      color 0.16s;
  }
  .view {
    animation: appear 0.2s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0.3;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
