:root {
  --ink: #172033;
  --muted: #65738a;
  --line: #dfe6f0;
  --accent: #0f8b8d;
  --accent-dark: #0a6567;
  --bg: #f5f1e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(15, 139, 141, .18), transparent 34rem),
    linear-gradient(135deg, #f5f1e8, #eaf1f4);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

main {
  width: min(920px, calc(100vw - 32px));
  margin: 24px 0;
  padding: 28px;
  border: 1px solid rgba(23, 32, 51, .1);
  border-radius: 28px;
  background: rgba(255, 253, 248, .88);
  box-shadow: 0 22px 60px rgba(34, 45, 62, .16);
  backdrop-filter: blur(14px);
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(24px, 5vw, 30px);
  letter-spacing: .03em;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-row { margin-bottom: 12px; }
.select-row { margin-bottom: 4px; }

input,
select {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  font: inherit;
  font-size: 16px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, .12);
}

select.muted-select {
  opacity: .55;
  background: #eef2f4;
}

button {
  width: 132px;
  height: 48px;
  border: 0;
  border-radius: 15px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) { background: var(--accent-dark); }
button:disabled { background: #9aa9ad; cursor: wait; }

#progress {
  min-height: 24px;
  margin: 16px 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.preview {
  display: grid;
  place-items: center;
  min-height: 500px;
  border: 1px dashed #bcc9d8;
  border-radius: 24px;
  background:
    linear-gradient(45deg, rgba(15, 139, 141, .06), transparent),
    rgba(255, 255, 255, .62);
  overflow: hidden;
}

.preview img {
  width: min(480px, 86vw);
  height: min(480px, 86vw);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 18px 38px rgba(23, 32, 51, .24);
}

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

pre {
  margin: 16px 0 0;
  color: var(--muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.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: 680px) {
  main {
    width: min(100% - 20px, 920px);
    padding: 20px;
    border-radius: 22px;
  }

  .row { align-items: stretch; }
  .input-row { flex-direction: column; }
  .input-row button { width: 100%; }
  .select-row { flex-direction: column; }
  .preview { min-height: min(480px, calc(100vw - 42px)); }
}
