:root {
  color-scheme: light;
  --ink: #24212b;
  --muted: #6f6a78;
  --soft-text: #3a3644;
  --line: #e4dfd7;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --panel-soft: #fff9ef;
  --mint: #dff6e8;
  --mint-strong: #8bd7ad;
  --lavender: #eee7ff;
  --sky: #e2f3fb;
  --coral: #ffb5a7;
  --yellow: #ffe99a;
  --acid: #c8ff77;
  --violet: #8b77dd;
  --red: #ff6f79;
  --shadow: 0 18px 42px rgba(53, 45, 35, 0.1);
  --shadow-soft: 0 10px 26px rgba(53, 45, 35, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  background:
    linear-gradient(135deg, #fbfaf5 0%, #f3fbf5 42%, #fff4ef 100%);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  border: 1px solid rgba(36, 33, 43, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 3rem;
  line-height: 1;
}

.eyebrow,
.section-label,
.question-count {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-actions,
.result-actions,
.question-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.intro-grid,
.quiz-layout,
.result-grid {
  display: grid;
  gap: 18px;
}

.intro-grid {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.intro-copy,
.progress-panel,
.question-panel,
.report-panel,
.chart-panel,
.dimension-panel,
.home-card {
  border: 1px solid rgba(36, 33, 43, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.intro-copy {
  padding: 48px;
  background:
    linear-gradient(145deg, rgba(223, 246, 232, 0.86), rgba(255, 255, 255, 0.92) 58%),
    var(--panel);
}

.intro-copy h2 {
  max-width: 680px;
  margin: 0 0 18px;
  font-size: 4.3rem;
  line-height: 1.02;
}

.intro-copy p {
  max-width: 720px;
  margin: 0 0 22px;
  color: var(--soft-text);
  font-size: 1.06rem;
  line-height: 1.85;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: 28px 0 8px;
}

.hero-stats div {
  border: 1px solid rgba(36, 33, 43, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
}

.hero-stats strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.notice-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.notice-strip span,
.result-tags span,
.pill-list span,
.verdict-main span {
  border: 1px solid rgba(36, 33, 43, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.2;
}

.notice-strip span {
  background: var(--yellow);
}

.primary-btn,
.ghost-btn,
.option-btn {
  min-height: 44px;
  border: 1px solid rgba(36, 33, 43, 0.12);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-btn {
  background: var(--ink);
  color: #fff;
  padding: 0 22px;
  font-weight: 800;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 800;
}

.primary-btn:hover,
.ghost-btn:hover,
.option-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(53, 45, 35, 0.14);
}

.home-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.home-card {
  padding: 24px;
}

.home-card h3,
.sample-results h3 {
  margin: 0 0 12px;
  font-size: 1.55rem;
  line-height: 1.25;
}

.home-card p {
  margin: 0;
  color: var(--soft-text);
  font-size: 1rem;
  line-height: 1.8;
}

.soft-card {
  background:
    linear-gradient(145deg, rgba(255, 233, 154, 0.28), rgba(255, 255, 255, 0.9)),
    #fff;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-list span {
  background: rgba(255, 255, 255, 0.86);
}

.personality-showcase {
  border: 1px solid rgba(36, 33, 43, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.showcase-head h3 {
  margin: 0 0 10px;
  font-size: 2.1rem;
  line-height: 1.12;
}

.showcase-head p {
  max-width: 660px;
  margin: 0;
  color: var(--soft-text);
  line-height: 1.75;
}

.showcase-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.showcase-meta span {
  border: 1px solid rgba(36, 33, 43, 0.12);
  border-radius: var(--radius-sm);
  background: var(--yellow);
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.personality-grid {
  display: grid;
  gap: 18px;
}

.personality-group {
  display: grid;
  gap: 12px;
}

.personality-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(36, 33, 43, 0.08);
  padding-top: 16px;
}

.personality-group:first-child .personality-group-head {
  border-top: 0;
  padding-top: 0;
}

.personality-group-head h4 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  line-height: 1.2;
}

.personality-group-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.personality-group-head > span {
  border-radius: var(--radius-sm);
  background: var(--mint);
  padding: 7px 10px;
  color: var(--soft-text);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.personality-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
}

.personality-tile {
  width: 100%;
  min-height: 136px;
  border: 1px solid rgba(36, 33, 43, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(223, 246, 232, 0.62), rgba(255, 255, 255, 0.92)),
    #fff;
  box-shadow: var(--shadow-soft);
  padding: 14px;
  overflow: hidden;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.personality-tile:hover,
.personality-tile:focus-visible {
  border-color: rgba(36, 33, 43, 0.26);
  box-shadow: 0 14px 30px rgba(53, 45, 35, 0.14);
  outline: 0;
  transform: translateY(-2px);
}

.personality-tile span {
  display: inline-block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.personality-tile strong {
  display: block;
  margin-top: 16px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.personality-tile p {
  margin: 10px 0 0;
  color: var(--soft-text);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.personality-tile small {
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.personality-group-extreme .personality-group-head > span {
  background: var(--coral);
}

.personality-group-extreme .personality-tile {
  background:
    linear-gradient(145deg, rgba(255, 181, 167, 0.62), rgba(255, 255, 255, 0.92)),
    #fff;
}

body.modal-open {
  overflow: hidden;
}

.personality-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.personality-modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgba(36, 33, 43, 0.48);
  cursor: pointer;
}

.modal-backdrop:hover,
.modal-backdrop:focus-visible {
  box-shadow: none;
  outline: 0;
  transform: none;
}

.personality-modal-card {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  border: 1px solid rgba(36, 33, 43, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(223, 246, 232, 0.78), rgba(255, 255, 255, 0.96) 42%),
    #fff;
  box-shadow: 0 26px 70px rgba(36, 33, 43, 0.24);
  padding: 28px;
}

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

.modal-head h2 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.98;
}

.modal-summary {
  width: fit-content;
  margin: 14px 0 0;
  border-radius: var(--radius-sm);
  background: var(--acid);
  padding: 8px 12px;
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.15;
}

.modal-close {
  flex: 0 0 auto;
}

.modal-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
  border-top: 1px solid rgba(36, 33, 43, 0.1);
  padding-top: 20px;
}

.modal-copy-grid p:not(.section-label) {
  margin: 0;
  color: var(--soft-text);
  font-size: 1.02rem;
  line-height: 1.85;
}

.modal-score-panel {
  margin-top: 24px;
  border-top: 1px solid rgba(36, 33, 43, 0.1);
  padding-top: 20px;
}

.modal-score-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.modal-score-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.modal-score-head > p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.6;
  text-align: right;
}

.modal-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.modal-score-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
}

.modal-score-row span {
  font-weight: 800;
}

.modal-score-row em {
  font-style: normal;
  text-align: right;
  font-weight: 900;
}

.modal-score-row em small {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  font-size: 0.75rem;
  line-height: 1;
}

.modal-score-row.level-high em small {
  background: var(--acid);
}

.modal-score-row.level-low em small {
  background: var(--sky);
}

.sample-results {
  grid-column: 1 / -1;
}

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

.sample-grid article {
  min-height: 152px;
  border: 1px solid rgba(36, 33, 43, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.sample-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.sample-grid strong {
  display: block;
  margin-top: 20px;
  font-size: 1.9rem;
  line-height: 1;
}

.sample-grid p {
  margin: 10px 0 0;
  color: var(--soft-text);
  font-weight: 900;
}

.quiz-layout {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
}

.progress-panel,
.question-panel,
.report-panel,
.chart-panel,
.dimension-panel {
  padding: 22px;
}

.progress-panel {
  position: sticky;
  top: 18px;
}

.progress-panel strong {
  display: block;
  margin-bottom: 18px;
  font-size: 2.35rem;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #eee8dc;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint-strong), var(--violet));
  transition: width 0.2s ease;
}

.mini-status {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.answer-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 18px;
}

.answer-dot {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 32px;
  place-items: center;
  border: 1px solid rgba(36, 33, 43, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.answer-dot:hover {
  transform: translateY(-1px);
  background: var(--yellow);
  color: var(--ink);
}

.answer-dot.is-answered {
  background: var(--mint);
  color: var(--ink);
}

.answer-dot.is-current {
  background: var(--ink);
  color: #fff;
}

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

.question-panel h2 {
  min-height: 96px;
  margin: 0 0 18px;
  font-size: 2.15rem;
  line-height: 1.32;
}

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

.option-btn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
  text-align: left;
}

.option-btn b {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--ink);
}

.option-btn span {
  line-height: 1.55;
}

.option-btn.is-selected {
  border-color: rgba(139, 119, 221, 0.42);
  background: var(--lavender);
}

.option-btn.is-selected b {
  background: var(--ink);
  color: #fff;
}

.question-actions {
  justify-content: space-between;
  margin-top: 18px;
}

.result-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  margin-bottom: 18px;
  border: 1px solid rgba(36, 33, 43, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(223, 246, 232, 0.82), rgba(255, 255, 255, 0.94)),
    #fff;
  box-shadow: var(--shadow);
  padding: 42px;
}

.result-head h2 {
  margin: 0;
  font-size: 5.8rem;
  line-height: 0.98;
}

.result-title-copy {
  max-width: 860px;
}

.result-summary-line {
  width: fit-content;
  margin: 14px 0 0;
  border-radius: var(--radius-sm);
  background: var(--acid);
  padding: 8px 12px;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.15;
}

.result-comment-lead {
  max-width: 820px;
  margin: 18px 0 0;
  color: var(--soft-text);
  font-size: 1.28rem;
  line-height: 1.78;
}

.result-grid {
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  margin-bottom: 18px;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.result-tags span {
  background: var(--yellow);
}

.verdict-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid rgba(36, 33, 43, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.verdict-main {
  padding: 22px;
}

.verdict-main span {
  display: inline-block;
  margin-bottom: 12px;
  background: var(--mint);
}

.verdict-main strong {
  display: block;
  max-width: 760px;
  font-size: 2.15rem;
  line-height: 1.2;
}

.verdict-main p {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.6;
}

.score-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 1px solid rgba(36, 33, 43, 0.08);
}

.score-summary div {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid rgba(36, 33, 43, 0.08);
  border-right: 1px solid rgba(36, 33, 43, 0.08);
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.score-summary div:nth-child(2),
.score-summary div:nth-child(3) {
  background: rgba(255, 244, 239, 0.86);
}

.score-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.score-summary strong {
  font-size: 2rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.report-panel h3,
.dimension-panel h3 {
  margin: 0 0 14px;
  font-size: 1.35rem;
}

.report-panel p {
  margin: 0 0 18px;
  color: var(--soft-text);
  font-size: 1.05rem;
  line-height: 1.85;
}

.result-meta {
  display: grid;
  gap: 12px;
  margin: 0;
}

.result-meta div {
  border-top: 1px solid rgba(36, 33, 43, 0.08);
  padding-top: 12px;
}

.result-meta dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.result-meta dd {
  margin: 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

#sharePreview {
  white-space: pre-line;
  color: #3d3945;
}

.chart-panel {
  min-height: 380px;
}

#radarCanvas {
  display: block;
  width: 100%;
  max-width: 680px;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.dimension-panel {
  margin-top: 18px;
}

.dimension-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.dimension-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
}

.dimension-row span {
  font-weight: 800;
}

.dimension-row em {
  font-style: normal;
  text-align: right;
  font-weight: 900;
}

.dimension-row em small {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  font-size: 0.75rem;
  line-height: 1;
}

.dimension-row.level-high em small {
  background: var(--acid);
}

.dimension-row.level-low em small {
  background: var(--sky);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eee8dc;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--violet);
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 22px, 720px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-grid,
  .quiz-layout,
  .result-grid,
  .verdict-panel,
  .dimension-bars,
  .modal-copy-grid,
  .modal-score-grid,
  .home-overview {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    padding: 30px;
  }

  .intro-copy h2 {
    font-size: 3rem;
  }

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

  .progress-panel {
    position: static;
  }

  .answer-map {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .showcase-head,
  .modal-head,
  .modal-score-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-score-head > p {
    max-width: none;
    text-align: left;
  }

  .result-head {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .result-head h2 {
    font-size: 4rem;
  }

  .result-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .result-actions button {
    flex: 1 1 150px;
  }

  .score-summary {
    border-top: 1px solid rgba(36, 33, 43, 0.08);
    border-left: 0;
  }

  .question-panel h2 {
    min-height: auto;
    font-size: 1.75rem;
  }

}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 18px, 520px);
  }

  .topbar h1 {
    font-size: 2.35rem;
  }

  .intro-copy {
    padding: 24px;
  }

  .intro-copy h2 {
    font-size: 2.35rem;
  }

  .hero-stats,
  .sample-grid,
  .score-summary {
    grid-template-columns: 1fr;
  }

  .answer-map {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .result-head h2 {
    font-size: 3.2rem;
  }

  .result-summary-line {
    font-size: 1.55rem;
  }

  .result-comment-lead {
    font-size: 1.05rem;
  }

  .personality-modal {
    padding: 12px;
  }

  .personality-modal-card {
    max-height: calc(100vh - 24px);
    padding: 22px;
  }

  .dimension-row,
  .modal-score-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dimension-row em,
  .modal-score-row em {
    text-align: left;
  }
}
