:root {
  --bg: #0e0e0e;
  --card: #171717;
  --text: #f5f5f5;
  --muted: #b3b3b3;
  --red: #ff0000;
  --red-dark: #cc0000;
  --line: #2a2a2a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  width: min(680px, 92vw);
  margin: 8vh auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

h1 {
  margin: 0 0 6px;
  color: var(--red);
}

.sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
}

input, select, button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101010;
  color: var(--text);
  padding: 11px 12px;
  font-size: 0.98rem;
}

button {
  background: var(--red);
  border: none;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--red-dark); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.secondary {
  background: #202020;
  border: 1px solid #2e2e2e;
  font-weight: 600;
}
.secondary:hover { background: #2a2a2a; }

.row { margin-top: 10px; }

.preview {
  margin: 14px 0 8px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  background: #121212;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.preview img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.preview-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.preview-duration {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-wrap {
  margin-top: 12px;
}

.progress-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress {
  width: 100%;
  height: 10px;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff3838, #ff0000);
  transition: width 0.25s ease;
}

.log-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.logs {
  margin-top: 8px;
  background: #0f0f0f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d6d6d6;
  font-size: 0.82rem;
}

.status {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
}

.hidden { display: none; }

@media (max-width: 560px) {
  .preview {
    grid-template-columns: 1fr;
  }
}
