:root {
  --bg: #fff7f8;
  --card: #ffffff;
  --ink: #2b2430;
  --muted: #8a7f8f;
  --line: #f0e3e8;
  --brand: #ff2e4d;
  --brand-soft: #ffe9ed;
  --ok: #0a9a6d;
  --err: #d6336c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, #fff7f8 0%, #fffdfd 100%);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

.hero { text-align: center; margin-bottom: 22px; }
.auth { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-ghost {
  border: 1px solid var(--line); background: #fff; color: var(--brand);
  border-radius: 999px; padding: 6px 16px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { background: var(--brand-soft); }
.btn-ghost.hidden { display: none; }
.who { font-size: 13px; color: var(--ok); }
.badge {
  display: inline-block; font-size: 13px; color: var(--brand);
  background: var(--brand-soft); border-radius: 999px; padding: 4px 14px; margin-bottom: 10px;
}
h1 { font-size: 26px; margin: 0 0 8px; }
.tagline { color: var(--muted); font-size: 14px; margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 6px 24px rgba(255, 46, 77, 0.06);
  margin-bottom: 18px;
}

.field { display: block; margin-bottom: 16px; }
.label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.label small { font-weight: 400; color: var(--muted); font-size: 12px; }
.label em { color: var(--brand); font-style: normal; }

input[type="text"], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 15px; color: var(--ink);
  background: #fffdfa; outline: none; font-family: inherit;
}
input[type="text"]:focus, textarea:focus, select:focus { border-color: var(--brand); }
textarea { resize: vertical; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

input[type="range"] { width: 100%; accent-color: var(--brand); }
output { color: var(--brand); font-weight: 700; }

.checks { display: flex; gap: 20px; margin: 4px 0 18px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }

.btn {
  width: 100%; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(90deg, #ff2e4d, #ff6a3d);
  color: #fff; font-size: 16px; font-weight: 700; padding: 13px;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.92; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; min-height: 1.2em; }
.hint.err { color: var(--err); }

.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-head h2 { font-size: 18px; margin: 0; }
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.output {
  font-size: 15px; word-break: break-word;
  background: #fffdfa; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; min-height: 80px;
}
.output p { margin: 0 0 12px; }

.covers-label { font-size: 14px; font-weight: 700; margin: 4px 0 10px; }
.covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 520px) { .covers { grid-template-columns: 1fr; } }
.cover-cell {
  border: 2px solid var(--line); border-radius: 12px; padding: 8px;
  cursor: pointer; text-align: center; transition: border-color 0.15s, background 0.15s;
}
.cover-cell:hover { border-color: #ffb3c0; }
.cover-cell.picked { border-color: var(--brand); background: var(--brand-soft); }
.cover-box svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.cover-tag { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cover-cell.picked .cover-tag { color: var(--brand); font-weight: 700; }
.output h1, .output h2, .output h3 { line-height: 1.4; }
.output code { background: var(--brand-soft); border-radius: 4px; padding: 1px 5px; }
.hidden { display: none; }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* 未登录提示条 */
.guest-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--brand-soft); border: 1px solid #ffc7d2;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 16px;
  font-size: 13px; color: var(--ink);
}
.guest-banner.hidden { display: none; }
.guest-banner strong { color: var(--brand); }
.banner-btn {
  flex-shrink: 0; border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(90deg, #ff2e4d, #ff6a3d); color: #fff;
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
}

/* 登录引导弹窗 */
.auth-gate {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(43, 36, 48, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-gate.hidden { display: none; }
.auth-gate-card {
  position: relative; width: 100%; max-width: 400px;
  background: #fff; border-radius: 18px; padding: 28px 24px 22px;
  box-shadow: 0 20px 60px rgba(43, 36, 48, 0.25);
  text-align: center;
}
.gate-x {
  position: absolute; top: 10px; right: 14px;
  border: none; background: none; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--muted); font-family: inherit;
}
.gate-x:hover { color: var(--ink); }
.gate-icon { font-size: 40px; margin-bottom: 6px; }
.auth-gate-card h2 { font-size: 20px; margin: 0 0 10px; }
.gate-desc { font-size: 14px; color: var(--ink); margin: 0 0 14px; text-align: left; }
.gate-desc strong { color: var(--brand); }
.gate-list {
  list-style: none; margin: 0 0 18px; padding: 0;
  text-align: left; font-size: 13px; color: var(--muted);
}
.gate-list li { margin-bottom: 6px; }
.auth-gate-card .btn { margin-bottom: 10px; }
.gate-later { width: 100%; }
