:root {
  color-scheme: light;
  --bg: #fff4f6;
  --paper: #fffdfb;
  --ink: #201f1d;
  --muted: #6f7774;
  --line: #d8eee8;
  --accent: #f39aae;
  --accent-2: #74d6c6;
  --soft: #e9fbf7;
  --green: #6f8d72;
}

* {
  box-sizing: border-box;
}

body,
.result,
.result-card,
.panel,
.long-desc,
.type-code,
.dimension-bars,
.details,
.disclaimer,
.author-contact-card {
  user-select: text;
  -webkit-user-select: text;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, #f1fbf8 0%, #fffaf8 36%, #fff4f7 68%, #eafbf7 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 36px 28px 72px;
}

.hero,
.result-card,
.panel,
.question-card {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 60px rgba(60, 50, 35, 0.08);
}

.hero {
  position: relative;
  min-height: auto;
  margin-top: clamp(22px, 6vh, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(58px, 6vw, 76px) 68px 48px;
  text-align: center;
}

.hero-top,
.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill,
.badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
}

.pill.muted {
  color: var(--muted);
  background: transparent;
}

.hero-badge {
  min-height: 38px;
  padding: 7px 30px;
  background: rgba(255, 255, 255, 0.74);
  color: #dd8ca1;
  letter-spacing: 0.14em;
  word-spacing: 0.22em;
}

h1 {
  margin: 24px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(51px, 4.9vw, 68px);
  line-height: 1.06;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.subtitle {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.64;
}

.hero-note {
  margin: 10px 0 32px;
  color: var(--muted);
  font-size: 18px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.6;
}

.hero-actions {
  justify-content: center;
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.type-chips {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  max-width: 860px;
}

.type-chips span:not(.chip-note) {
  min-height: 42px;
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #5f5254;
  font-weight: 900;
}

.chip-note {
  color: var(--muted);
  font-weight: 600;
}

.footer-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.primary,
.secondary {
  min-height: 52px;
  padding: 0 28px;
  border-radius: 16px;
  font-weight: 800;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:disabled {
  background: #beb7aa;
  cursor: not-allowed;
}

.secondary {
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--line);
}

.hidden {
  display: none;
}

.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(12px);
}

.eyebrow,
.result-kicker {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.progress {
  position: relative;
  height: 10px;
  overflow: visible;
  border-radius: 999px;
  background: var(--soft);
}

#progressFill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f39aae, #ffc2cf, #74d6c6);
  transition: width 0.2s ease;
  overflow: hidden;
}

.progress-bubble {
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 2px solid rgba(255, 126, 169, 0.78);
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.72),
    0 2px 8px rgba(255, 126, 169, 0.16);
  animation: bubble-rise 1s ease-out forwards;
  pointer-events: none;
  z-index: 4;
}

.progress-bubble::before,
.progress-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 154, 188, 0.7);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.72);
}

.progress-bubble::before {
  top: 11px;
  width: 6px;
  height: 6px;
  transform: translateX(-50%);
}

.progress-bubble::after {
  top: 22px;
  width: 4px;
  height: 4px;
  transform: translateX(-50%);
}

@keyframes bubble-rise {
  from {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.45) rotate(-8deg);
  }
  25% {
    opacity: 1;
  }
  55% {
    transform: translate(10px, -12px) scale(1) rotate(6deg);
  }
  to {
    opacity: 0;
    transform: translate(34px, -46px) scale(1.55) rotate(12deg);
  }
}

.question-card {
  margin-bottom: 14px;
  padding: 22px;
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.q-index {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  opacity: 0.76;
}

.category {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(233, 251, 247, 0.72);
  color: rgba(221, 126, 151, 0.72);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.question-title {
  margin: 0;
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.option {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.option:hover,
.option.selected {
  border-color: var(--accent);
  background: #f5efe4;
}

.option .letter {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font-weight: 900;
  line-height: 1;
}

.option-text {
  flex: 1;
  display: flex;
  align-items: center;
  color: var(--ink);
  line-height: 1.48;
}

.submit {
  width: 100%;
  margin: 18px 0 48px;
}

.result {
  padding-bottom: 64px;
}

.result-card,
.panel {
  position: relative;
  margin-bottom: 18px;
  padding: 28px;
}

.language-tabs {
  position: absolute;
  top: 20px;
  right: 22px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.language-tabs span {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

.language-tabs .active {
  background: var(--accent);
  color: white;
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.result-kicker {
  margin: 0 0 16px;
  color: #8b817d;
  font-size: 16px;
  font-weight: 650;
}

#typeCode {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 17vw, 118px);
  line-height: 0.92;
}

#typeName {
  margin: 4px 0 0;
  font-size: 30px;
}

.avatar {
  width: 190px;
  aspect-ratio: 220 / 260;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
}

.avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

blockquote {
  margin: 28px 0;
  padding-left: 18px;
  border-left: 6px solid var(--accent);
  color: var(--muted);
  font-size: 22px;
  font-style: italic;
  line-height: 1.55;
}

blockquote span {
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
}

blockquote strong {
  color: var(--muted);
  font-weight: 700;
}

.type-code {
  display: grid;
  gap: 18px;
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.type-code span {
  color: var(--accent);
  font-weight: 900;
}

.type-code p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.dimension-bars {
  display: grid;
  gap: 18px;
}

.dimension-bar {
  display: grid;
  gap: 8px;
}

.dimension-labels,
.dimension-meter {
  display: grid;
  gap: 12px;
  align-items: center;
}

.dimension-labels {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.dimension-meter {
  grid-template-columns: 48px minmax(120px, 1fr) 48px;
}

.dimension-labels {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.dimension-left {
  text-align: left;
}

.dimension-right {
  text-align: right;
}

.dimension-vs {
  color: #d59bab;
  font-size: 13px;
  font-weight: 900;
}

.dimension-percent {
  color: var(--muted);
  font-weight: 900;
}

.dimension-active {
  color: var(--accent);
}

.dimension-track {
  position: relative;
  min-width: 120px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe7ee, #eeeeea 50%, #ffe7ee);
}

.dimension-track::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 1px;
  height: 18px;
  background: rgba(111, 119, 116, 0.22);
}

.dimension-dot {
  position: absolute;
  top: 50%;
  left: var(--dot-position);
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(243, 154, 174, 0.34);
  transform: translate(-50%, -50%);
}

.result-stats-card {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 24px;
  padding: 10px;
  border: 1px solid #f3d8df;
  border-radius: 16px;
  background: rgba(255, 247, 249, 0.82);
}

.result-stats-card span {
  flex: 1 1 150px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.result-stats-card strong {
  color: var(--accent);
  font-size: 16px;
}

.result-inner-panel {
  margin: 24px 0 0;
  box-shadow: none;
}

.author-contact-card {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(236, 160, 185, 0.28);
  border-radius: 20px;
  background: rgba(255, 250, 252, 0.75);
  color: #777;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}

.author-contact-title {
  margin-bottom: 6px;
  color: #555;
  font-weight: 700;
  text-align: center;
}

.author-contact-text {
  color: #777;
  text-align: center;
}

.author-contact-handle {
  margin-top: 6px;
  color: #e98dad;
  font-weight: 700;
  text-align: center;
}

.long-desc,
.population,
.disclaimer p {
  color: #625d56;
  font-size: 17px;
  line-height: 1.75;
}

.long-desc {
  display: grid;
  gap: 18px;
  margin-top: 0;
}

.long-desc p {
  margin: 0;
}

.sub-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 22px;
  align-items: start;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.sub-card span,
.mini-cards span {
  color: var(--muted);
  font-weight: 800;
}

.sub-card strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  line-height: 0.95;
}

.sub-card h4 {
  margin: 8px 0 0;
  font-size: 22px;
}

.sub-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.sub-card .sub-definition {
  color: #4f4a43;
}

.mini-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.mini-cards div {
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.mini-cards strong {
  display: block;
  margin-top: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.mini-cards p {
  margin: 6px 0 0;
  color: var(--muted);
}

.mini-cards small {
  display: block;
  margin-top: 12px;
  color: #625d56;
  font-size: 14px;
  line-height: 1.55;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel h3 {
  margin: 0;
  font-size: 26px;
}

.ghost {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 900;
}

.radar-wrap {
  display: grid;
  place-items: center;
  padding-top: 16px;
}

.radar-code-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

canvas {
  max-width: 100%;
  width: min(100%, 440px);
  height: auto;
}

.details {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.detail-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.detail-row strong {
  font-size: 17px;
}

.detail-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.score {
  color: var(--accent);
  font-weight: 900;
}

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

.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(32, 31, 29, 0.45);
}

.share-modal-overlay.hidden {
  display: none;
}

.share-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(420px, 100%);
  max-height: 88vh;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(236, 160, 185, 0.35);
  border-radius: 24px;
  background: #fffdf8;
  box-shadow: 0 22px 70px rgba(32, 31, 29, 0.24);
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-modal-header h3 {
  margin: 0;
  font-size: 20px;
}

.share-modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
}

.share-modal-tip {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.share-preview-scroll {
  max-height: 62vh;
  overflow-y: auto;
  border-radius: 18px;
}

.share-preview-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(236, 160, 185, 0.35);
  border-radius: 16px;
  object-fit: contain;
}

.share-modal-actions {
  display: flex;
  gap: 12px;
}

.share-modal-actions button {
  flex: 1;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 800;
}

.gallery {
  padding-bottom: 64px;
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 250, 251, 0.92);
}

.gallery-head h2 {
  margin: 4px 0 0;
  font-size: 34px;
}

.avatar-gallery {
  display: grid;
  gap: 18px;
}

.zone-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 250, 251, 0.92);
}

.zone-head {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  color: #2d2929;
}

.zone-head h3 {
  margin: 0;
  font-size: 24px;
}

.zone-head p {
  margin: 0;
  color: rgba(32, 31, 29, 0.68);
  line-height: 1.5;
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  padding: 12px;
}

.avatar-tile {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.avatar-tile .avatar {
  width: 100%;
  margin: 0 auto;
}

.avatar-tile strong {
  display: block;
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.avatar-tile span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 680px) {
  .app {
    width: min(760px, 100%);
    padding: 8px;
  }

  .hero {
    width: min(88vw, 340px);
    margin: 34px auto 0;
    padding: 30px 8px 22px;
    border-radius: 22px;
  }

  .hero-badge {
    min-height: 30px;
    padding: 6px 13px;
    font-size: 10px;
    letter-spacing: 0.09em;
    word-spacing: 0.18em;
  }

  h1 {
    margin: 20px 0 14px;
    font-size: clamp(29px, 9.1vw, 36px);
    line-height: 1.1;
  }

  .subtitle {
    max-width: 280px;
    font-size: 14px;
    line-height: 1.66;
  }

  .hero-note {
    margin: 16px 0 22px;
    font-size: 14px;
    line-height: 1.66;
  }

  .type-chips {
    max-width: 300px;
    gap: 7px 4px;
  }

  .type-chips span:not(.chip-note) {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .chip-note {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    font-size: 10px;
  }

  .hero-actions {
    margin-top: 24px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .hero-actions .primary,
  .hero-actions .secondary {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 14px;
  }

  .footer-note {
    margin-top: 18px;
    font-size: 12px;
  }

  .hero-actions,
  .sub-card,
  .mini-cards,
  .actions {
    grid-template-columns: 1fr;
  }

  .sticky-bar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .question-card {
    padding: 22px 20px;
  }

  .q-index {
    font-size: 12px;
  }

  .category {
    padding: 4px 8px;
    font-size: 9.5px;
  }

  .question-title {
    font-size: 17px;
    line-height: 1.34;
    letter-spacing: -0.01em;
  }

  .option {
    gap: 12px;
    padding: 13px;
  }

  .option .letter {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .option-text {
    font-size: 14px;
    line-height: 1.5;
  }

  .result-card,
  .panel {
    padding: 20px;
    border-radius: 20px;
  }

  .result-head {
    align-items: flex-start;
  }

  .result-kicker {
    margin-bottom: 12px;
    font-size: 14px;
  }

  #typeCode {
    font-size: clamp(48px, 15vw, 78px);
  }

  #typeName {
    font-size: 23px;
  }

  .avatar {
    width: 126px;
  }

  blockquote {
    margin: 22px 0;
    font-size: 18px;
  }

  .long-desc,
  .population,
  .disclaimer p {
    font-size: 15px;
  }

  .author-contact-card {
    padding: 16px;
    font-size: 12.5px;
  }

  .type-code {
    padding: 16px;
  }

  .dimension-labels {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    gap: 8px;
  }

  .dimension-meter {
    grid-template-columns: 40px minmax(84px, 1fr) 40px;
    gap: 8px;
  }

  .dimension-labels {
    font-size: 12px;
  }

  .dimension-percent {
    font-size: 13px;
  }

  .dimension-track {
    min-width: 84px;
  }

  .result-stats-card {
    margin-bottom: 20px;
  }
}
