:root {
  color-scheme: light;
  --page: #111827;
  --panel: #f6f7f9;
  --text: #111827;
  --muted: #4b5563;
  --line: #d8dbe1;
  --hot: #d4144f;
  --clear: #687281;
  --good: #16a34a;
  --soft: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(18, 48, 86, 0.95)),
    #111827;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 0 20px 42px;
}

.panel {
  width: min(744px, 100%);
  margin-top: 0;
  padding: 32px 36px 36px;
  border-radius: 0 0 8px 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

h1 {
  margin: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0;
}

.logo {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 34px;
  border-radius: 3px;
  color: #f9fafb;
  font-size: 28px;
  line-height: 1;
  background: linear-gradient(180deg, #4053a5, #5a3b73);
}

.form {
  display: grid;
  gap: 12px;
}

input,
button,
.download {
  width: 100%;
  min-height: 68px;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
}

input {
  height: 64px;
  padding: 0 26px;
  border: 2px solid var(--line);
  background: var(--soft);
  color: #020617;
  font-size: 20px;
  font-weight: 500;
  outline: none;
}

input:focus {
  border-color: #99a6b8;
  box-shadow: 0 0 0 3px rgba(99, 116, 139, 0.18);
}

button,
.download {
  border: 0;
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: grid;
  place-items: center;
  transition:
    transform 0.16s ease,
    filter 0.16s ease;
}

button:hover,
.download:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.primary {
  margin-top: 14px;
  background: var(--hot);
  font-size: 22px;
}

.secondary {
  background: var(--clear);
  font-size: 22px;
}

.message {
  min-height: 28px;
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 15px;
}

.message.error {
  color: #b91c1c;
}

.result {
  margin-top: 22px;
  padding: 26px 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.result h2 {
  margin: 0 0 20px 4px;
  font-size: 20px;
}

.result h2 span {
  color: var(--good);
}

.info {
  padding: 24px 20px;
  border-radius: 8px;
  background: var(--soft);
  color: #334155;
}

.info p {
  margin: 8px 0;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
}

.preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 18px;
  border-radius: 8px;
  display: block;
  background: #020617;
  object-fit: contain;
}

.preview[hidden] {
  display: none;
}

.download {
  margin-top: 20px;
  min-height: 52px;
  background: var(--good);
  font-size: 15px;
}

.gallery {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.gallery a {
  min-height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0f766e;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .page {
    padding-inline: 12px;
  }

  .panel {
    padding: 26px 18px 28px;
  }

  h1 {
    gap: 12px;
    font-size: 28px;
    margin-bottom: 28px;
  }

  input {
    font-size: 17px;
    padding-inline: 18px;
  }

  .primary,
  .secondary {
    font-size: 19px;
  }

  .result {
    padding: 20px 16px;
  }
}
