:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e4e9;
  --text: #1c1d21;
  --muted: #6b6e76;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger-bg: #fdecec;
  --danger-text: #b42318;
  --success-bg: #e9f6ee;
  --success-text: #197741;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.container {
  max-width: 640px;
  margin: 48px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 20px; font-weight: 600; margin: 0; }
.hint { font-size: 12px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.row { display: flex; gap: 10px; }

input[type="text"] {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
input[type="text"]:focus { border-color: var(--primary); }

.btn-primary {
  height: 40px;
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #aebfe6; cursor: not-allowed; }
.btn-primary.block { width: 100%; margin-top: 14px; }

.modes {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}
.modes label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.alert {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
}
.alert.error { background: var(--danger-bg); color: var(--danger-text); }
.alert.success {
  background: var(--success-bg);
  color: var(--success-text);
  display: flex;
  align-items: center;
  gap: 14px;
}
.done-title { margin: 0; font-weight: 600; }
.done-file { margin: 2px 0 0; font-size: 13px; }
.alert.success .btn-primary { margin-left: auto; background: var(--success-text); }

.meta { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.meta img {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  flex-shrink: 0;
}
.meta-text { min-width: 0; }
.title { margin: 0; font-size: 15px; font-weight: 600; }
.subtitle { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.list-hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }

.formats { display: flex; flex-direction: column; gap: 6px; }
.fmt {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}
.fmt:hover { border-color: #c4cbe0; }
.fmt.selected { border-color: var(--primary); border-width: 2px; padding: 9px 11px; }
.fmt input { margin: 0; }
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
}
.tag.video { background: #e8efff; color: var(--primary-hover); }
.tag.audio { background: var(--success-bg); color: var(--success-text); }
.fmt .label { font-weight: 600; }
.fmt .detail { color: var(--muted); }
.fmt .size { margin-left: auto; color: var(--muted); }

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
}
.stage { font-weight: 600; }
.progress-meta { color: var(--muted); }
.bar {
  height: 8px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.hidden { display: none !important; }
