:root {
  --bg: #0f172a;
  --surface: #111827;
  --accent: #38bdf8;
  --text: #e2e8f0;
  --muted: #94a3b8;
  font-size: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.08), transparent 26%), \
    radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.12), transparent 30%), \
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.main {
  width: min(720px, 100%);
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.header {
  margin-bottom: 20px;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

button {
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(135deg, #22d3ee, #38bdf8);
  color: #0f172a;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.32);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.25);
}

.output {
  margin-top: 18px;
}

.output__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.output__header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.output__body {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1rem;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.image-result {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.image-result img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.6);
}
