:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #6d5efc;
  --brand-ink: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(31, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
}

.gear {
  color: var(--brand);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.feature .ico {
  font-size: 22px;
}

.feature:active {
  transform: scale(0.98);
}

.feature.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.15);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.blurb {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.uploads {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.drop {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fafbff;
}

.drop:hover,
.drop.drag {
  border-color: var(--brand);
  background: #f3f1ff;
}

.drop .label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.drop .hint {
  font-size: 12px;
  color: var(--muted);
}

.drop img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  margin-top: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.drop input[type="file"] {
  display: none;
}

.options {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.field select,
.field input[type="text"],
.field textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 44px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.row .field {
  flex: 1 1 160px;
  margin-bottom: 0;
}

.radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
}

.radio input {
  accent-color: var(--brand);
}

.radio.checked {
  border-color: var(--brand);
  background: #f3f1ff;
  color: var(--brand);
}

.btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: var(--brand);
  color: var(--brand-ink);
}

.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

.status.loading {
  color: var(--brand);
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.status.err {
  color: var(--err);
}

.result img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.result .actions {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.result a.btn {
  text-decoration: none;
  text-align: center;
}

.result a.btn.ghost {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

details.prompt {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

details.prompt pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f7fb;
  padding: 10px;
  border-radius: 10px;
  font-size: 12px;
}

.hidden {
  display: none;
}

@media (min-width: 560px) {
  .uploads.two {
    grid-template-columns: 1fr 1fr;
  }
}
