:root {
  --ink: #101114;
  --muted: #6c7078;
  --paper: #f4f1ea;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(16, 17, 20, 0.12);
  --accent: #ff5c35;
  --accent-dark: #df3f1e;
  --error: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 92, 53, 0.13), transparent 34rem),
    radial-gradient(circle at 90% 85%, rgba(36, 76, 173, 0.09), transparent 31rem),
    var(--paper);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 34px;
}

.hero { max-width: 760px; }

.brand {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 38px;
  color: #fff;
  background: var(--ink);
  border-radius: 14px;
  font-size: 25px;
  font-weight: 800;
  transform: rotate(-3deg);
  box-shadow: 8px 8px 0 rgba(255, 92, 53, 0.22);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.lead {
  max-width: 620px;
  margin: 24px 0 42px;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.7;
}

.card {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 22px 70px rgba(35, 31, 23, 0.1);
  backdrop-filter: blur(18px);
}

label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 750;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input {
  width: 100%;
  min-width: 0;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font: inherit;
  transition: border-color 150ms, box-shadow 150ms;
}

input:focus {
  border-color: rgba(255, 92, 53, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 92, 53, 0.1);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 0 24px;
  color: white;
  background: var(--ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: transform 150ms, background 150ms, opacity 150ms;
}

button:hover { transform: translateY(-1px); background: #282a2f; }
button:disabled { cursor: wait; opacity: 0.5; transform: none; }

.token-field { margin-top: 18px; }
.token-field input { max-width: 360px; }

.status-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.progress-track {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 17, 20, 0.09);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 300ms ease;
}

.results-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.results-panel[hidden] { display: none; }

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.results-kicker {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: clamp(22px, 3.5vw, 30px);
  letter-spacing: -0.03em;
}

.download-all,
.video-download {
  min-height: 44px;
  padding: 0 18px;
  background: var(--accent);
  white-space: nowrap;
}

.download-all:hover,
.video-download:hover { background: var(--accent-dark); }

.video-list {
  display: grid;
  gap: 18px;
}

.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.video-preview {
  display: block;
  width: 100%;
  max-height: 520px;
  background: #090a0c;
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
}

.video-meta h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.video-meta p {
  max-width: 560px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-message {
  margin: 18px 0 0;
  color: var(--error);
  font-size: 14px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 12px;
}
.dot { opacity: 0.45; }

@media (max-width: 640px) {
  .shell { width: min(100% - 24px, 880px); padding-top: 34px; }
  .brand { margin-bottom: 30px; }
  .lead { margin-bottom: 30px; }
  .card { padding: 20px; border-radius: 19px; }
  .input-row { grid-template-columns: 1fr; }
  .input-row button { min-height: 52px; }
  .results-heading { align-items: stretch; flex-direction: column; }
  .download-all { width: 100%; }
  .video-meta { align-items: stretch; flex-direction: column; }
  .video-download { width: 100%; }
}
