:root {
  --ink: #182e3b;
  --muted: #647783;
  --line: #dbe2e5;
  --paper: #fff;
  --ground: #f3f5f5;
  --accent: #176b77;
  --pale: #eaf2f2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  font:
    14px/1.6 system-ui,
    "Noto Sans CJK SC",
    "Microsoft YaHei",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 550;
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
button:hover:enabled {
  filter: brightness(0.94);
}
button.secondary {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #e0b453;
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c7d1d6;
  border-radius: 4px;
  padding: 8px 9px;
  background: white;
  color: var(--ink);
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}
input[type="file"] {
  font-size: 12px;
  padding: 7px;
}
label {
  display: block;
  font-size: 12px;
  color: #425864;
  margin: 13px 0 5px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 13px 0;
}
.check input {
  margin: 0;
}
.separated {
  margin-top: 36px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  letter-spacing: 1px;
  font-weight: 600;
  margin: 6px 0 8px;
}
h2 {
  font-size: 15px;
  font-weight: 600;
}
.top {
  height: 68px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 48px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}
.brand-mark {
  width: 29px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 24px;
}
nav {
  display: flex;
  gap: 28px;
  height: 100%;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
nav span {
  height: 100%;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--accent);
  color: var(--ink);
}
#language {
  width: 95px;
  margin-left: auto;
  padding: 5px;
}
main {
  max-width: 1680px;
  margin: auto;
  padding: 30px 36px 0;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  gap: 20px;
}
.eyebrow {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 2px;
}
.intro {
  color: var(--muted);
  font-size: 13px;
}
.connection {
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  flex-wrap: wrap;
}
.connection label {
  margin: 0 0 0 20px;
}
.connection input {
  width: 250px;
}
.status-dot {
  width: 7px;
  height: 7px;
  background: #99a8af;
  border-radius: 50%;
}
.connection.connected .status-dot {
  background: var(--accent);
}
.connection strong {
  font-size: 12px;
}
.small {
  font-size: 12px;
  color: var(--muted);
}
#notice {
  padding: 8px 0;
  min-height: 37px;
  font-size: 13px;
  color: var(--accent);
  overflow-wrap: anywhere;
}
#notice.error {
  color: #a24036;
}
.workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 18px;
  border-radius: 3px;
  min-width: 0;
}
.panel-title,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-head {
  justify-content: space-between;
}
.step {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 1px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}
details {
  margin-top: 14px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  color: var(--accent);
}
details[open] > summary {
  margin-bottom: 12px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pair > div {
  min-width: 0;
}
form button,
#analyze {
  width: 100%;
  margin-top: 15px;
}
.metadata {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 14px;
  font-size: 12px;
}
.metadata dt {
  color: var(--muted);
}
.metadata dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.scope {
  font-size: 12px;
  padding: 10px 12px;
  border-left: 2px solid #a9bcc2;
  background: #f6f8f8;
  margin: 12px 0;
  color: #50636c;
}
.scope:empty {
  display: none;
}
.viewer {
  padding: 0;
  overflow: hidden;
}
.viewer-head {
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.viewer-head h2 {
  margin-top: 5px;
}
.tag {
  font-size: 11px;
  color: var(--accent);
  padding: 3px 8px;
  background: var(--pale);
  border-radius: 2px;
}
.view-tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.view-tabs button {
  color: var(--muted);
  background: #fff;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  padding: 7px 12px;
}
.view-tabs button.active {
  color: var(--ink);
  background: #e9edef;
}
.image-stage {
  height: 500px;
  background: #192126;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}
.image-stage img[hidden] {
  display: none;
}
#empty {
  text-align: center;
  color: #b1bdc4;
  padding: 20px;
}
.empty-symbol {
  display: block;
  font-size: 38px;
  color: #6c8592;
  margin-bottom: 10px;
}
#empty span:last-child {
  font-size: 12px;
  color: #849aa6;
}
#empty p {
  font-size: 14px;
  margin-bottom: 8px;
}
.image-footer {
  padding: 10px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.text-button {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  margin-left: auto;
  font-size: 12px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 20px 0;
}
.metric {
  border-right: 1px solid var(--line);
  padding-right: 12px;
  min-width: 0;
}
.metric:last-child {
  border: 0;
}
.metric strong {
  display: block;
  font-size: 27px;
  line-height: 1.3;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.metric span {
  font-size: 11px;
  color: var(--muted);
}
.metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 17px;
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  color: var(--muted);
  text-align: left;
  font-weight: 500;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  border-bottom: 1px solid #edf0f1;
  padding: 12px 8px;
  max-width: 280px;
  overflow-wrap: anywhere;
}
td button {
  font-size: 11px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 350px;
  overflow: auto;
  font: 11px/1.7 monospace;
  color: #4a606d;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
  padding: 15px 0 25px;
  border-top: 1px solid var(--line);
  margin-top: 15px;
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 340px minmax(0, 1fr);
  }
  .image-stage {
    height: 560px;
  }
}
@media (max-width: 1050px) {
  .top {
    padding: 0 20px;
    gap: 25px;
  }
  main {
    padding: 24px 20px 0;
  }
  .workspace {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 14px;
  }
  .panel {
    padding: 16px;
  }
  .viewer {
    padding: 0;
  }
  .viewer-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .image-stage {
    height: 390px;
  }
  .review-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric:nth-child(2) {
    border: 0;
  }
  .connection .small {
    display: none;
  }
}
@media (max-width: 720px) {
  .top {
    height: auto;
    min-height: 62px;
    padding: 14px 16px;
    gap: 15px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 12px;
  }
  .brand-mark {
    width: 24px;
    height: 25px;
    font-size: 19px;
  }
  nav {
    order: 3;
    width: 100%;
    gap: 20px;
  }
  nav span {
    border: 0;
  }
  #language {
    width: 85px;
  }
  main {
    padding: 20px 14px 0;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
  }
  h1 {
    font-size: 24px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .workspace > aside,
  .results {
    width: 100%;
  }
  .connection {
    gap: 9px;
    padding: 12px;
  }
  .connection label {
    margin: 0;
    width: 100%;
  }
  .connection input {
    flex: 1;
    width: 150px;
  }
  .image-stage {
    height: 360px;
  }
  .image-footer {
    flex-wrap: wrap;
  }
  footer {
    flex-direction: column;
    gap: 6px;
  }
  .view-tabs button {
    padding: 7px 10px;
  }
  .section-head {
    align-items: flex-start;
    gap: 10px;
  }
  .section-head .small {
    max-width: 120px;
  }
}

.legend {
  padding: 0 20px 12px;
  min-height: 28px;
  overflow-wrap: anywhere;
}
