:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: #f5f7fa;
  color: #20252d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  width: min(1280px, 100%);
  margin: 0 auto;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
  font-weight: 700;
}

.topbar p {
  margin-top: 8px;
  color: #697381;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.status-pill {
  min-width: 112px;
  padding: 9px 12px;
  border: 1px solid #cfd8e3;
  background: #ffffff;
  border-radius: 6px;
  text-align: center;
  color: #334155;
  font-size: 14px;
}

.upload-panel,
.control-panel,
.job-panel,
.summary-grid,
.result-layout {
  margin-top: 14px;
}

.upload-panel,
.control-panel,
.job-panel {
  display: grid;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid #d8e0ea;
  background: #ffffff;
  border-radius: 8px;
}

.upload-panel {
  grid-template-columns: minmax(260px, 1fr) 120px 120px 136px;
}

.control-panel {
  grid-template-columns: minmax(260px, 1fr) 136px;
}

.job-panel {
  grid-template-columns: minmax(260px, 1fr) 112px 112px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  font-size: 13px;
  color: #596579;
}

input {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 11px;
  background: #fbfdff;
  color: #1f2937;
  outline: none;
}

input[type="file"] {
  padding: 8px 10px;
}

input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button {
  height: 40px;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  cursor: not-allowed;
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
}

#stopBtn {
  border-color: #b91c1c;
  background: #dc2626;
}

#stopBtn:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
}

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

.metric {
  min-height: 82px;
  padding: 14px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #ffffff;
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  color: #182230;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.table-wrap,
.json-wrap {
  border: 1px solid #d8e0ea;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}

.section-head {
  min-height: 46px;
  padding: 13px 14px;
  border-bottom: 1px solid #e5ebf2;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #526071;
  background: #f8fafc;
  font-weight: 600;
}

.empty {
  color: #7b8794;
  text-align: center;
}

pre {
  min-height: 360px;
  max-height: 560px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #101828;
  color: #d1e7ff;
  font: 13px/1.6 Consolas, "Courier New", monospace;
}

@media (max-width: 860px) {
  .app {
    padding: 14px;
  }

  .topbar,
  .result-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .upload-panel,
  .control-panel,
  .job-panel,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .status-pill {
    width: 100%;
  }
}
