:root {
  --bg: #fdf6f9;
  --card: #ffffff;
  --ink: #3d2c3a;
  --muted: #8a7288;
  --accent: #e86fa0;
  --accent-2: #c86bd6;
  --line: #f0dfe8;
  --shadow: 0 10px 40px rgba(180, 120, 160, 0.14);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
.bg-blob {
  position: fixed; z-index: 0; border-radius: 50%;
  filter: blur(80px); opacity: 0.35; pointer-events: none;
}
.b1 { width: 420px; height: 420px; background: #ffd3e4; top: -120px; right: -100px; }
.b2 { width: 380px; height: 380px; background: #e6d6ff; bottom: -120px; left: -120px; }

.wrap { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; padding: 40px 20px 60px; }

.head { text-align: center; margin-bottom: 28px; }
.logo { font-size: 30px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { color: var(--muted); margin: 8px 0 0; font-size: 14px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow); padding: 24px;
}
.panel { margin-bottom: 22px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

select, input[type="text"], input[type="password"] {
  width: 100%; padding: 11px 13px; font-size: 15px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; background: #fdfafc;
  outline: none; transition: border .15s, box-shadow .15s;
}
select:focus, input[type="text"]:focus, input[type="password"]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 111, 160, .12);
}
.img-settings input { margin-top: 8px; }

.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1; padding: 10px 6px; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: #fdfafc; color: var(--muted);
  transition: all .15s;
}
.seg-btn.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent; font-weight: 600;
}
.hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.actions { display: flex; gap: 12px; margin-top: 6px; }
button { font-size: 15px; border-radius: 13px; cursor: pointer; transition: transform .06s, opacity .15s, background .15s; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary {
  flex: 1; padding: 13px; border: none; color: #fff; font-weight: 700; font-size: 16px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(232, 111, 160, .32);
}
.ghost {
  padding: 13px 20px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}

.out { margin-bottom: 22px; }
.out-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.out-head h2 { margin: 0; font-size: 20px; }
.badge {
  font-size: 12px; color: var(--accent); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.story {
  white-space: pre-wrap; word-break: break-word; font-size: 16px; line-height: 2;
  max-height: 60vh; overflow-y: auto; padding: 4px 6px 4px 0;
}
.story p { margin: 0 0 14px; }
.story::-webkit-scrollbar { width: 8px; }
.story::-webkit-scrollbar-thumb { background: #efd4e0; border-radius: 8px; }
.out-actions { display: flex; gap: 12px; margin-top: 16px; }

textarea {
  width: 100%; padding: 11px 13px; font-size: 15px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; background: #fdfafc;
  outline: none; resize: vertical; min-height: 76px; line-height: 1.6; font-family: inherit;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 111, 160, .12); }

.img-wrap { margin-top: 16px; text-align: center; }
.img-wrap img {
  max-width: 100%; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(180, 120, 160, .18); display: block; margin: 0 auto;
}
.img-wrap .ghost { display: inline-block; margin-top: 12px; text-decoration: none; }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }
.foot p { margin: 4px 0; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
