:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #66717f;
  --line: #dce2e8;
  --accent: #146c65;
  --accent-strong: #0e5650;
  --accent-soft: #e5f3f1;
  --warn: #b25b18;
  --danger: #b42318;
  --shadow: 0 14px 38px rgba(18, 29, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.status-pill {
  min-width: 96px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.dropzone,
.controls,
.metrics,
.preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dropzone {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 122px;
  padding: 22px;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.drop-title {
  margin: 0 0 5px;
  font-size: 18px;
  font-weight: 700;
}

.drop-subtitle {
  margin: 0;
  color: var(--muted);
  word-break: break-all;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  white-space: nowrap;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.ghost {
  background: #fff;
  color: var(--accent);
  border-color: #b9cbc8;
}

.ghost:hover:not(:disabled) {
  background: var(--accent-soft);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  padding: 0;
}

.metric {
  min-width: 0;
  padding: 16px 18px;
  background: #fff;
}

.metric .label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.progress-wrap {
  display: grid;
  grid-template-columns: 1fr 54px;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e8ed;
}

#progressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #3a8f7a);
  transition: width 140ms ease;
}

#progressText {
  color: var(--muted);
  text-align: right;
}

.preview {
  overflow: hidden;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-head span {
  color: var(--muted);
}

.table-scroll {
  max-height: 420px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f5;
  color: #33404d;
  font-weight: 700;
}

td {
  overflow-wrap: anywhere;
}

th:nth-child(1),
td:nth-child(1) {
  width: 28%;
}

th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3) {
  width: 84px;
}

.empty {
  height: 86px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

@media (max-width: 760px) {
  .topbar,
  .dropzone {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .dropzone {
    justify-items: start;
  }

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

  .controls {
    align-items: stretch;
  }

  .controls button {
    flex: 1 1 160px;
  }
}
