:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ea;
  --line-strong: #b9c6d4;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #dff8f3;
  --danger: #b42318;
  --warn: #b54708;
  --shadow: 0 18px 44px rgba(20, 30, 48, 0.09);
  --shadow-soft: 0 8px 22px rgba(20, 30, 48, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eaf1f5 0, rgba(234, 241, 245, 0) 320px),
    var(--bg);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

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

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

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

.brand p,
.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warn);
}

.status-pill.online .status-dot {
  background: #12b76a;
}

.status-pill.offline .status-dot {
  background: var(--danger);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
}

.control-panel,
.result-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
  padding: 20px;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 210px;
  place-items: center;
  gap: 7px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfe;
  text-align: center;
}

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

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 34px;
  line-height: 1;
}

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

.drop-copy,
.info-box span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.summary-grid div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.actions {
  display: grid;
  gap: 10px;
}

.primary,
.secondary,
.ghost {
  min-height: 42px;
  padding: 0 16px;
}

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

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

.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.ghost:hover {
  background: #eef2f6;
  color: var(--ink);
}

.info-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.result-section {
  min-height: 640px;
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.empty-state {
  display: grid;
  min-height: 500px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 24px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.empty-state h3 {
  margin: 14px 0 6px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 16px;
}

.result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.card-head,
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.card-head {
  border-bottom: 1px solid var(--line);
}

.file-name {
  max-width: 230px;
  margin-bottom: 4px;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
}

.badge.done {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge.failed {
  background: #fee4e2;
  color: var(--danger);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 250px;
}

.preview-box {
  position: relative;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 26px 12px 12px;
  background: #f8fafc;
}

.preview-box + .preview-box {
  border-left: 1px solid var(--line);
}

.preview-box span {
  position: absolute;
  top: 8px;
  left: 10px;
  color: var(--muted);
  font-size: 12px;
}

.checker {
  background:
    linear-gradient(45deg, #e4e9f0 25%, transparent 25%),
    linear-gradient(-45deg, #e4e9f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e4e9f0 75%),
    linear-gradient(-45deg, transparent 75%, #e4e9f0 75%);
  background-color: #fff;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  background-size: 16px 16px;
}

.preview-box img {
  display: block;
  max-width: 100%;
  max-height: 260px;
}

.card-actions {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 16px;
  }

  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .status-pill {
    width: 100%;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .preview-box + .preview-box {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
