:root {
  --bg: #f7f4ef;
  --card: #fffdfa;
  --text: #2f2a26;
  --muted: #8a8178;
  --line: #e8e0d5;
  --accent: #d97757;
  --accent-soft: #fbeee8;
  --ok: #4f8a6b;
  --err: #c0553f;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -200px, #fdf6ec 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 660px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}

.head { text-align: center; margin-bottom: 28px; }

.head h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: 0.5px;
}

.head .sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 12px 32px rgba(120, 95, 70, 0.07);
}

.dropzone {
  border: 1.5px dashed #d9cdbd;
  border-radius: 16px;
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .12s;
}

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

.dropzone:active { transform: scale(0.995); }

.dz-icon { color: var(--accent); margin-bottom: 8px; }

.dz-title { margin: 0 0 6px; font-size: 15px; font-weight: 550; }

.dz-hint { margin: 0; color: var(--muted); font-size: 12.5px; }

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 16px;
  background: #faf6f0;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.file-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.file-name {
  font-size: 14px;
  font-weight: 550;
  word-break: break-all;
}

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

.link-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.link-btn:hover { color: var(--err); background: rgba(192, 85, 63, 0.08); }

button.primary {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}

button.primary:hover:not(:disabled) { opacity: .92; }
button.primary:active:not(:disabled) { transform: scale(0.995); }
button.primary:disabled { background: #e2d7c8; cursor: not-allowed; }

.progress { margin-top: 22px; }

.bar {
  height: 6px;
  background: #f0e8dd;
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #e79a78, var(--accent));
  transition: width .35s ease;
}

.stages {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.stages li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
}

.stages li .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #dccfbf;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  transition: all .2s;
}

.stages li.active { color: var(--text); font-weight: 550; }

.stages li.active .dot {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin .8s linear infinite;
}

.stages li.done { color: var(--ok); }

.stages li.done .dot {
  background: var(--ok);
  border-color: var(--ok);
}

@keyframes spin { to { transform: rotate(360deg); } }

.progress-msg {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  min-height: 18px;
}

.result {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #cfe3d5;
  border-radius: 14px;
  background: #f3faf5;
}

.result h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--ok);
}

.result .meta {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: #63756a;
  line-height: 1.8;
  word-break: break-all;
}

.result a.download {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 13px;
  border-radius: 11px;
  background: var(--ok);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
}

.result a.download:hover { opacity: .92; }

.warn {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fdf6e7;
  border: 1px solid #f0e0bd;
  color: #8a6d33;
  font-size: 12.5px;
  line-height: 1.7;
}

.error {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fdf0ec;
  border: 1px solid #f0cfc5;
  color: var(--err);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.foot {
  margin-top: 26px;
  text-align: center;
  color: #a19689;
  font-size: 12px;
  line-height: 1.9;
}

.foot p { margin: 4px 0; }

@media (max-width: 480px) {
  .page { padding-top: 34px; }
  .head h1 { font-size: 25px; }
  .card { padding: 18px; border-radius: 16px; }
  .dropzone { padding: 28px 14px; }
}
