:root {
  color-scheme: light;
  --bg: #f3eee7;
  --ink: #1c1a19;
  --panel: rgba(255, 252, 248, 0.86);
  --line: rgba(28, 26, 25, 0.14);
  --accent: #d86035;
  --accent-dark: #9e3513;
  --ok: #1e7a4d;
  --error: #a63030;
  --shadow: 0 18px 48px rgba(41, 28, 17, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(216, 96, 53, 0.24), transparent 30%),
    radial-gradient(circle at bottom right, rgba(76, 126, 102, 0.18), transparent 35%),
    linear-gradient(160deg, #f7f2eb 0%, #efe7db 100%);
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  padding: 12px 4px 28px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(28, 26, 25, 0.62);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.96;
}

.subhead {
  max-width: 620px;
  margin: 18px 0 0;
  font-size: 1.06rem;
  line-height: 1.7;
  color: rgba(28, 26, 25, 0.74);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.convert-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  color: rgba(28, 26, 25, 0.75);
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.toggle-copy {
  display: grid;
  gap: 4px;
}

.toggle-copy strong {
  font-size: 0.96rem;
}

.toggle-copy small {
  color: rgba(28, 26, 25, 0.62);
  line-height: 1.5;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

input[type="file"],
select,
button {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font: inherit;
}

input[type="file"],
select {
  background: rgba(255, 255, 255, 0.86);
}

button {
  background: var(--accent);
  color: #fff7f0;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.status[data-kind="success"] {
  color: var(--ok);
}

.status[data-kind="error"] {
  color: var(--error);
}

.output-panel {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.output-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: rgba(28, 26, 25, 0.7);
}

.ffmpeg-output {
  margin: 0;
  height: 220px;
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: #171412;
  color: #f4e8d8;
  font: 13px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.workflow {
  position: relative;
  margin-top: 18px;
  padding: 20px 12px 8px;
}

.workflow-line {
  position: absolute;
  top: 30px;
  left: 28px;
  right: 28px;
  height: 2px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-segment {
  height: 2px;
  background: rgba(28, 26, 25, 0.14);
  transition: background 120ms ease;
}

.workflow-segment[data-state="done"] {
  background: linear-gradient(90deg, #d86035 0%, #ea9a54 100%);
}

.workflow-stages {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workflow-stage {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  position: relative;
}

.workflow-dot {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(28, 26, 25, 0.18);
  background: #f7f2eb;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.workflow-check {
  position: absolute;
  top: -1px;
  z-index: 2;
  opacity: 0;
  color: #fff7f0;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.workflow-label {
  font-size: 0.88rem;
  color: rgba(28, 26, 25, 0.56);
  transition: color 120ms ease;
}

.workflow-stage[data-state="current"] .workflow-dot {
  background: #fff7f0;
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 0 6px rgba(216, 96, 53, 0.12);
}

.workflow-stage[data-state="done"] .workflow-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.workflow-stage[data-state="done"] .workflow-check {
  opacity: 1;
}

.workflow-stage[data-state="current"] .workflow-label,
.workflow-stage[data-state="done"] .workflow-label {
  color: var(--ink);
}

.progress {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.progress-track {
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(28, 26, 25, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d86035 0%, #ea9a54 100%);
  transition: width 120ms ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.92rem;
  color: rgba(28, 26, 25, 0.7);
}

.tips {
  margin-top: 16px;
  color: rgba(28, 26, 25, 0.65);
  font-size: 0.94rem;
  line-height: 1.7;
}

.tips p {
  margin: 6px 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px 0;
  color: rgba(28, 26, 25, 0.7);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--accent-dark);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 960px);
    padding-top: 28px;
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .workflow {
    padding-left: 0;
    padding-right: 0;
  }

  .workflow-line {
    left: 16px;
    right: 16px;
  }

  .workflow-label {
    font-size: 0.8rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
  }
}
