:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --ink: #1f2933;
  --muted: #5f6b76;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --error: #b42318;
  --warning: #b54708;
  --info: #175cd3;
  --border: #e4dfd3;
  --shadow: 0 18px 40px rgba(31, 41, 51, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 32%),
    linear-gradient(180deg, #faf7f0 0%, var(--bg) 100%);
  min-height: 100vh;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 620px;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  white-space: nowrap;
}

.status-pill.ok { color: var(--accent); background: var(--accent-soft); }
.status-pill.bad { color: var(--error); }

.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.upload-card { grid-row: span 2; }

h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.field span { color: var(--muted); }

input[type="file"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

select { border-style: solid; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  cursor: pointer;
}

.btn.primary {
  width: 100%;
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.btn.primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.hint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.empty {
  color: var(--muted);
  padding: 28px 0;
  text-align: center;
}

.hidden { display: none !important; }

.meta-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.meta-list div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
}

.meta-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.meta-list dd {
  margin: 0;
  word-break: break-all;
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2f6;
  font-size: 12px;
  text-transform: uppercase;
}

.badge.done { background: #dcfae6; color: #067647; }
.badge.failed { background: #fee4e2; color: var(--error); }
.badge.checking, .badge.parsing, .badge.converting, .badge.queued {
  background: #fef0c7;
  color: var(--warning);
}

.progress-bar {
  margin-top: 18px;
  height: 8px;
  background: #ece7dc;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #0f766e);
  transition: width 0.35s ease;
}

.progress-text {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.report-card { grid-column: 2; }

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.report-actions { display: flex; gap: 8px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.summary-item {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.summary-item strong {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
}

.summary-item span {
  font-size: 12px;
  color: var(--muted);
}

.summary-item.error strong { color: var(--error); }
.summary-item.warning strong { color: var(--warning); }
.summary-item.info strong { color: var(--info); }

.quality-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.6;
}

.issue {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
}

.issue.error { border-left-color: var(--error); }
.issue.warning { border-left-color: var(--warning); }
.issue.info { border-left-color: var(--info); }

.issue-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.issue code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
}

.issue p {
  margin: 0 0 6px;
  line-height: 1.55;
}

.issue small {
  color: var(--muted);
  display: block;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .upload-card, .report-card { grid-row: auto; grid-column: auto; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .header { flex-direction: column; }
}
