:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: #f4f6f8;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.panel,
.results,
.history-panel {
  background: #ffffff;
  border: 1px solid #d7dde4;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 32px rgba(31, 41, 51, 0.08);
}

.title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

p {
  margin: 0;
  color: #52606d;
}

.status {
  min-width: 96px;
  text-align: center;
  padding: 8px 10px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #f8fafc;
  color: #334e68;
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

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

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

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

.compact {
  max-width: 520px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #334e68;
}

.upload {
  padding: 16px;
  border: 1px dashed #9fb3c8;
  border-radius: 8px;
  background: #f8fbff;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #1f2933;
}

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

button,
.downloads a {
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  background: #1769aa;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.results {
  margin-top: 22px;
}

.history-panel {
  margin-top: 22px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 20px;
}

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

.history-item {
  border: 1px solid #d7dde4;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.history-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #102a43;
  font-weight: 700;
}

.history-files {
  color: #52606d;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.history-stats span {
  border: 1px solid #cbd5df;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ffffff;
  color: #334e68;
  font-size: 13px;
}

.history-links {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.history-links a {
  color: #1769aa;
  font-weight: 700;
  text-decoration: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  border: 1px solid #d7dde4;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.metric span {
  display: block;
  color: #627d98;
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.downloads {
  margin-bottom: 16px;
}

#plot {
  display: block;
  width: 100%;
  border: 1px solid #d7dde4;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 820px) {
  .title-row,
  .two,
  .three,
  .six,
  .metrics {
    grid-template-columns: 1fr;
    display: grid;
  }

  .actions {
    justify-content: stretch;
  }

  button,
  .downloads a {
    width: 100%;
    text-align: center;
  }
}
