:root {
  --bg: #fff5f2;
  --panel: #fffdfb;
  --ink: #241314;
  --muted: #806765;
  --line: #f0d6d1;
  --accent: #d73337;
  --accent-deep: #8f171f;
  --accent-soft: #ffe6e1;
  --cream: #fff9ee;
  --danger: #a54545;
  --shadow: 0 18px 50px rgba(142, 28, 32, 0.1);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 231, 224, 0.95), transparent 34%),
    linear-gradient(135deg, #fffaf6 0%, #fff2ef 48%, #fce7de 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 16px 56px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  padding: clamp(22px, 4vw, 42px);
  margin-bottom: 18px;
  border-color: #f2c8c2;
  background:
    radial-gradient(circle at 100% 0%, rgba(215, 51, 55, 0.18), transparent 34%),
    linear-gradient(135deg, #fffdfb, #fff4ef);
}

.hero h1 {
  margin: 8px 0 12px;
  max-width: 720px;
  font-size: clamp(34px, 7vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.08em;
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}

.hero-cta {
  display: inline-flex;
  margin-top: 22px;
  text-decoration: none;
}

.hero-creators,
.share-creator-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hero-creators {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.hero-creators a,
.share-creator-links a {
  color: var(--accent-deep);
  font-weight: 800;
  text-decoration: none;
}

.hero-creators a:hover,
.share-creator-links a:hover {
  text-decoration: underline;
}

.creator-separator {
  color: #b68a84;
}

.hero-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  transform: rotate(2deg);
}

.hero-avatar {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: #f1eff9;
  box-shadow: 0 14px 28px rgba(133, 38, 35, 0.1);
}

.hero-avatar:nth-child(even) {
  transform: translateY(20px);
}

.mystery-avatar img {
  filter: grayscale(1) blur(3px);
  opacity: 0.62;
  transform: scale(0.96);
}

.mystery-avatar::after {
  content: "?";
  position: absolute;
  inset: auto 10px 8px auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-deep);
  color: white;
  font-weight: 900;
}

.hero-avatar img,
.type-avatar img,
.result-avatar img,
.share-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px;
  margin-bottom: 18px;
}

.toolbar .status {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  padding: 11px 16px;
  font-weight: 700;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(215, 51, 55, 0.22);
}

.btn-danger {
  background: #fff3f3;
  color: var(--danger);
  border-color: #f1c1c1;
}

.btn-active {
  background: var(--accent-soft);
  border-color: #d6a58e;
  color: #8d4c32;
}

.stack {
  display: grid;
  gap: 18px;
}

.section {
  padding: clamp(16px, 3vw, 26px);
}

.section h2,
.section h3 {
  margin: 0 0 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 42px);
  letter-spacing: -0.05em;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.type-gallery-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 244, 0.98)),
    radial-gradient(circle at 5% 5%, rgba(215, 51, 55, 0.08), transparent 32%);
}

.type-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.type-card {
  position: relative;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px;
  background: white;
  box-shadow: 0 10px 24px rgba(105, 24, 24, 0.06);
}

.type-avatar {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 16px;
  background: #f1eff9;
}

.type-card-copy {
  display: grid;
  gap: 4px;
  min-height: 90px;
}

.type-code {
  width: fit-content;
  border: 1px solid #f1c2bc;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.type-card strong {
  font-size: 18px;
}

.type-card small {
  color: var(--muted);
  line-height: 1.5;
}

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

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field label,
.subtle {
  font-size: 13px;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fffdfa;
  color: var(--ink);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.question-card .option-row {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.test-form {
  display: grid;
  gap: 16px;
}

.question-box {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #fff;
}

.question-title {
  margin: 0 0 10px;
  line-height: 1.7;
  font-size: 16px;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 16px;
  background: #fffdfa;
}

.choice:has(input:checked) {
  border-color: #de605d;
  background: #fff1ed;
  box-shadow: 0 8px 20px rgba(215, 51, 55, 0.08);
}

.choice input {
  margin-top: 4px;
}

.result-card {
  border: 1px solid #efbdb7;
  background:
    radial-gradient(circle at top right, rgba(215, 51, 55, 0.13), transparent 30%),
    linear-gradient(180deg, #fff7f2, #fffefa);
}

.result-stack {
  display: grid;
  gap: 18px;
}

.gallery-gate {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 0 0;
  text-align: center;
}

.share-card {
  width: min(100%, 700px);
  margin: 0 auto;
  padding: 16px;
  border: 2px solid #1f1212;
  border-radius: 30px;
  color: #1f1212;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 241, 0.98)),
    radial-gradient(circle at 85% 12%, rgba(215, 51, 55, 0.2), transparent 28%);
  box-shadow: 0 24px 60px rgba(111, 28, 24, 0.18);
}

.share-card-top,
.share-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-avatar {
  width: min(62vw, 248px);
  aspect-ratio: 1;
  margin: 14px auto 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #f1eff9;
  box-shadow: 0 18px 38px rgba(111, 28, 24, 0.14);
}

.share-heading {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.share-code {
  margin: 0;
  color: #201112;
  font-size: clamp(44px, 15vw, 84px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.08em;
}

.share-title {
  margin: 0;
  text-align: center;
  font-size: clamp(32px, 8vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.share-label {
  width: fit-content;
  margin: 4px auto 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.share-tagline {
  margin: 12px auto 8px;
  color: var(--accent-deep);
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
}

.share-description {
  max-width: 52ch;
  margin: 0 auto 10px;
  color: #4f3432;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.62;
}

.radar-chart {
  width: min(100%, 290px);
  margin: 0 auto 10px;
}

.radar-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.radar-guide {
  fill: none;
  stroke: rgba(143, 23, 31, 0.18);
  stroke-width: 1;
}

.radar-axis {
  stroke: rgba(143, 23, 31, 0.18);
  stroke-width: 1;
}

.radar-fill {
  fill: rgba(215, 51, 55, 0.22);
}

.radar-stroke {
  fill: none;
  stroke: var(--accent-deep);
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.radar-dot {
  fill: var(--accent);
  stroke: white;
  stroke-width: 1.4;
}

.radar-label {
  fill: var(--accent-deep);
  font-size: 11px;
  font-weight: 900;
}

.match-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.match-chip {
  border: 1px solid #efc5bf;
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.match-chip strong,
.match-chip span {
  display: block;
}

.match-chip strong {
  font-size: 12px;
  line-height: 1.35;
}

.match-chip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(160px, 260px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.result-avatar {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  box-shadow: 0 18px 38px rgba(111, 28, 24, 0.14);
}

.share-creator-links {
  max-width: 75%;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}

.kicker {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.result-title {
  margin: 0 0 8px;
  font-size: clamp(34px, 6vw, 70px);
  line-height: 1;
  letter-spacing: -0.08em;
}

.result-tagline {
  font-weight: 800;
  color: var(--accent-deep);
}

.score-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.score-chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: white;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.54);
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-stack {
    grid-template-columns: repeat(4, 1fr);
    transform: none;
  }

  .hero-avatar:nth-child(even) {
    transform: none;
  }

  .section-head {
    display: block;
  }

  .type-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-card {
    padding: 14px;
    border-radius: 24px;
  }

  .share-avatar {
    width: min(68vw, 220px);
  }

  .share-code {
    font-size: clamp(38px, 14vw, 64px);
  }

  .share-title {
    font-size: clamp(28px, 8vw, 40px);
  }

  .match-list {
    grid-template-columns: 1fr;
  }

  .toolbar .status {
    width: 100%;
    margin-left: 0;
  }

  .share-card-top,
  .share-card-footer {
    align-items: flex-start;
  }

  .share-creator-links {
    max-width: 100%;
  }
}
