* { box-sizing: border-box; }

body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  padding: 40px 16px;
  color: #1f2733;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(79, 120, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 200, 160, 0.10), transparent 60%),
    linear-gradient(160deg, #f5f7fb 0%, #eef1f7 100%);
}

.card {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(31, 39, 51, 0.08);
  border-radius: 16px;
  padding: 28px 32px 32px;
  box-shadow: 0 8px 30px rgba(31, 39, 51, 0.10);
}

/* ---------- header ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid #eef0f4;
}
.hero-logo {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #4f78ff, #6a5cff);
  box-shadow: 0 4px 12px rgba(79, 120, 255, 0.35);
}
h1 { font-size: 21px; margin: 0; line-height: 1.3; }
.hint { color: #6b7280; font-size: 13px; margin: 4px 0 0; }

/* ---------- form ---------- */
.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: #1f2733;
  border: 1px solid #d7dce3;
  border-radius: 10px;
  background: #fafbfd;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:hover { border-color: #aeb6c2; }
select:focus {
  border-color: #4f78ff;
  box-shadow: 0 0 0 3px rgba(79, 120, 255, 0.15);
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 168px;
  padding: 24px 16px;
  border: 2px dashed #c3cbd8;
  border-radius: 12px;
  background: #fafbfd;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: #4f78ff;
  background: #f2f6ff;
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dz-icon { color: #4f78ff; margin-bottom: 2px; }
.dz-text { font-size: 15px; font-weight: 600; color: #1f2733; }
.dz-sub { font-size: 12px; color: #8a93a3; }

button {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, #4f78ff, #5f62ff);
  box-shadow: 0 4px 14px rgba(79, 120, 255, 0.35);
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}
button:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(79, 120, 255, 0.45); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.msg { min-height: 20px; margin: 12px 0 0; font-size: 14px; }
.msg.error { color: #d64545; }

/* ---------- status ---------- */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.meta-item {
  background: #f7f9fc;
  border: 1px solid #eceef3;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}
.meta-label {
  display: block;
  font-size: 11px;
  color: #8a93a3;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.meta-item > span:last-child,
.meta-item code {
  display: block;
  font-size: 13px;
  color: #1f2733;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-item code {
  font-family: Consolas, "Courier New", monospace;
  background: transparent;
  padding: 0;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress {
  flex: 1;
  background: #e8ecf2;
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}
.bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f78ff, #6a5cff);
  transition: width 0.4s ease;
}
.bar.working {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.22) 25%, transparent 25%,
    transparent 50%, rgba(255, 255, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.22) 75%, transparent 75%, transparent
  );
  background-size: 28px 28px;
  animation: bar-move 0.8s linear infinite;
}
@keyframes bar-move {
  from { background-position: 0 0; }
  to { background-position: 28px 0; }
}
.progress-text {
  flex: none;
  width: 46px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: #4f78ff;
  text-align: right;
}

.status {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 14px 0 4px;
}
.error { color: #d64545; font-weight: 600; }

/* ---------- outputs ---------- */
.outputs h2 {
  font-size: 16px;
  margin: 18px 0 12px;
  color: #1f2733;
}
.download-list { display: flex; flex-direction: column; gap: 10px; }
.download-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #e2e6ee;
  border-radius: 10px;
  background: #fafbfd;
  text-decoration: none;
  color: #1f2733;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.download-btn:hover {
  border-color: #4f78ff;
  background: #f2f6ff;
  transform: translateY(-1px);
}
.dl-name { font-weight: 600; }
.dl-info { font-size: 12px; color: #8a93a3; }
.download-btn::after {
  content: "\2193";
  color: #4f78ff;
  font-weight: 700;
  font-size: 16px;
}

/* ---------- log ---------- */
.log-box {
  margin-top: 20px;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  background: #14181f;
  overflow: hidden;
}
.log-box summary {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #c9d4e3;
  background: #1a1f29;
  cursor: pointer;
  user-select: none;
}
pre#log {
  margin: 0;
  padding: 12px 14px;
  color: #aebad0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.back { margin: 20px 0 0; }
.back a {
  color: #4f78ff;
  text-decoration: none;
  font-size: 14px;
}
.back a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .meta-grid { grid-template-columns: 1fr; }
  body { padding: 20px 12px; }
}
