:root {
  color-scheme: light;
  --paper: #f7f3eb;
  --ink: #1f2a2e;
  --muted: #637074;
  --line: #d9d0c2;
  --panel: #fffaf2;
  --teal: #1b7f79;
  --teal-deep: #0f5e5a;
  --coral: #d86b52;
  --gold: #d99b2b;
  --blue: #5074b8;
  --shadow: 0 24px 70px rgba(31, 42, 46, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background:
    linear-gradient(135deg, rgba(27, 127, 121, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(216, 107, 82, 0.12), transparent 40%),
    var(--paper);
  color: var(--ink);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.84fr) minmax(360px, 1.16fr);
  gap: 24px;
  align-items: center;
  padding: 32px 0;
}

.brand-panel,
.test-panel {
  border: 1px solid rgba(31, 42, 46, 0.1);
  background: rgba(255, 250, 242, 0.88);
  box-shadow: var(--shadow);
}

.brand-panel {
  min-height: 660px;
  display: grid;
  align-content: space-between;
  gap: 40px;
  padding: 42px;
  overflow: hidden;
  position: relative;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: auto -16% -14% auto;
  width: 360px;
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, rgba(31, 42, 46, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(31, 42, 46, 0.1) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: rotate(-10deg);
}

.brand-copy,
.type-visual {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--teal-deep);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 8em;
  margin-bottom: 18px;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.summary,
.result-copy,
.notice {
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.notice {
  margin: 24px 0 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

.fine-print {
  max-width: 34rem;
  margin: 12px 0 0;
  color: rgba(99, 112, 116, 0.84);
  font-size: 0.82rem;
  line-height: 1.7;
}

.type-visual {
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(31, 42, 46, 0.16);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 250, 242, 0.96) 0 28%, transparent 29%),
    conic-gradient(from 24deg, rgba(27, 127, 121, 0.24), rgba(216, 107, 82, 0.2), rgba(217, 155, 43, 0.24), rgba(80, 116, 184, 0.2), rgba(27, 127, 121, 0.24));
}

.axis {
  position: absolute;
  display: flex;
  justify-content: space-between;
  color: rgba(31, 42, 46, 0.72);
  font-weight: 820;
}

.axis-vertical {
  top: 24px;
  bottom: 24px;
  flex-direction: column;
}

.axis-horizontal {
  left: 24px;
  right: 24px;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(31, 42, 46, 0.22);
  inset: 19%;
}

.orbit-one {
  transform: rotate(26deg);
}

.orbit-two {
  transform: rotate(-26deg);
}

.core-mark {
  width: 128px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 42, 46, 0.22);
  background: var(--panel);
  color: var(--teal-deep);
  font-size: 0.94rem;
  font-weight: 860;
}

.test-panel {
  min-height: 660px;
  padding: 42px;
}

.view {
  display: none;
}

.view.is-active {
  min-height: 576px;
  display: flex;
  flex-direction: column;
}

.start-grid {
  display: grid;
  gap: 32px;
  align-items: end;
  grid-template-columns: 1fr auto;
}

.mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 18px;
}

.mode-card {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  display: grid;
  align-content: start;
  gap: 8px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.mode-card:hover {
  transform: translateY(-1px);
  border-color: rgba(27, 127, 121, 0.7);
}

.mode-card.is-active {
  border-color: var(--teal);
  background: rgba(27, 127, 121, 0.1);
  box-shadow: inset 0 0 0 2px rgba(27, 127, 121, 0.18);
}

.mode-card span {
  color: var(--teal-deep);
  font-size: 0.82rem;
  font-weight: 820;
}

.mode-card strong {
  font-size: 1.55rem;
  line-height: 1;
}

.mode-card small {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.primary-action,
.secondary-action,
.ghost-action,
.answer-button {
  min-height: 48px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.primary-action {
  padding: 0 22px;
  background: var(--teal);
  color: #fff;
  font-weight: 780;
}

.secondary-action {
  padding: 0 18px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
  font-weight: 760;
}

.primary-action:hover,
.secondary-action:hover,
.answer-button:hover,
.ghost-action:hover {
  transform: translateY(-1px);
}

.primary-action:active,
.secondary-action:active,
.answer-button:active,
.ghost-action:active {
  transform: translateY(0);
}

.dimension-strip {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.dimension-strip span {
  min-height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 820;
  background: rgba(255, 255, 255, 0.38);
}

.quiz-top {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 20px;
  align-items: start;
}

.ghost-action {
  width: 48px;
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  font-size: 1.2rem;
}

.progress-track {
  height: 8px;
  margin: 32px 0;
  background: #eadfce;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--coral), var(--gold));
  transition: width 240ms ease;
}

.answer-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.answer-list.is-fun-scale {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.answer-button {
  width: 100%;
  min-height: 96px;
  padding: 14px 10px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  text-align: center;
  font-weight: 720;
  line-height: 1.35;
  display: grid;
  place-items: center;
  position: relative;
}

.answer-button:hover {
  border-color: rgba(27, 127, 121, 0.72);
  background: rgba(27, 127, 121, 0.08);
}

.answer-button:disabled {
  cursor: default;
}

.answer-button.is-selected {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 2px currentColor;
  transform: translateY(-1px);
}

.answer-button.was-selected {
  background: rgba(255, 255, 255, 0.72);
}

.answer-button.is-selected::before {
  background: currentColor;
  opacity: 0.95;
}

.answer-button.is-muted {
  opacity: 0.42;
}

.answer-button::before {
  content: "";
  width: 18px;
  aspect-ratio: 1;
  border: 2px solid currentColor;
  opacity: 0.38;
  margin-bottom: 8px;
}

.answer-button:nth-child(1),
.answer-button:nth-child(2) {
  color: var(--blue);
}

.answer-button:nth-child(3) {
  color: var(--muted);
}

.answer-button:nth-child(4),
.answer-button:nth-child(5) {
  color: var(--coral);
}

.answer-list.is-fun-scale .answer-button:nth-child(1) {
  color: var(--blue);
}

.answer-list.is-fun-scale .answer-button:nth-child(2) {
  color: var(--teal-deep);
}

.answer-list.is-fun-scale .answer-button:nth-child(3) {
  color: var(--coral);
}

.scale-guide {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: -12px 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.scale-guide span:nth-child(2) {
  text-align: center;
}

.scale-guide span:last-child {
  text-align: right;
}

.result-head {
  margin-bottom: 28px;
}

.result-head .notice {
  max-width: 38rem;
}

#type-code {
  color: var(--teal-deep);
}

.type-character {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: center;
  margin: -4px 0 24px;
  padding: 18px;
  border: 1px solid rgba(31, 42, 46, 0.1);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--char-primary) 15%, transparent), transparent 46%),
    rgba(255, 255, 255, 0.4);
}

.character-avatar {
  --skin: #f4c7a6;
  width: 132px;
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.avatar-shadow,
.avatar-body,
.avatar-head,
.avatar-hair,
.avatar-face,
.avatar-prop {
  position: absolute;
  display: block;
}

.avatar-shadow {
  width: 82px;
  height: 14px;
  left: 25px;
  bottom: 12px;
  background: rgba(31, 42, 46, 0.14);
  border-radius: 999px;
  filter: blur(1px);
  z-index: -1;
}

.avatar-body {
  width: 78px;
  height: 64px;
  left: 27px;
  bottom: 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 42%),
    var(--char-primary);
  border: 3px solid rgba(31, 42, 46, 0.72);
  border-radius: 24px 24px 18px 18px;
}

.avatar-body::before,
.avatar-body::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 38px;
  top: 8px;
  background: var(--char-secondary);
  border: 3px solid rgba(31, 42, 46, 0.72);
  border-radius: 999px;
}

.avatar-body::before {
  left: -18px;
  transform: rotate(18deg);
}

.avatar-body::after {
  right: -18px;
  transform: rotate(-18deg);
}

.avatar-head {
  width: 72px;
  height: 66px;
  left: 30px;
  top: 18px;
  background: var(--skin);
  border: 3px solid rgba(31, 42, 46, 0.78);
  border-radius: 46% 46% 42% 42%;
  z-index: 2;
}

.avatar-hair {
  width: 80px;
  height: 38px;
  left: 26px;
  top: 10px;
  background: var(--char-primary);
  border: 3px solid rgba(31, 42, 46, 0.78);
  border-radius: 42px 42px 22px 22px;
  z-index: 3;
}

.avatar-hair::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 34px;
  right: 6px;
  bottom: -17px;
  background: var(--char-primary);
  border-radius: 0 0 14px 14px;
}

.avatar-face {
  width: 38px;
  height: 18px;
  left: 47px;
  top: 50px;
  z-index: 4;
}

.avatar-face::before,
.avatar-face::after {
  content: "";
  position: absolute;
  top: 0;
  width: 6px;
  aspect-ratio: 1;
  background: rgba(31, 42, 46, 0.86);
  border-radius: 999px;
}

.avatar-face::before {
  left: 2px;
}

.avatar-face::after {
  right: 2px;
}

.avatar-prop {
  width: 30px;
  aspect-ratio: 1;
  right: 14px;
  top: 70px;
  background: var(--char-accent);
  border: 3px solid rgba(31, 42, 46, 0.76);
  z-index: 5;
}

.character-copy {
  min-width: 0;
}

.character-label {
  display: block;
  margin-bottom: 7px;
  color: var(--char-primary);
  font-size: 0.78rem;
  font-weight: 840;
}

.character-copy strong {
  display: block;
  color: var(--ink);
  font-size: 1.24rem;
  line-height: 1.2;
}

.character-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.character-emblem-map .avatar-prop {
  width: 34px;
  height: 24px;
  border-radius: 4px;
  transform: rotate(-8deg);
}

.character-emblem-map .avatar-prop::before,
.character-emblem-book .avatar-prop::before,
.character-emblem-chart .avatar-prop::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-top: 3px solid rgba(31, 42, 46, 0.55);
  border-bottom: 3px solid rgba(31, 42, 46, 0.55);
}

.character-emblem-atom .avatar-prop {
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(31, 42, 46, 0.8) 0 3px, transparent 4px),
    var(--char-accent);
}

.character-emblem-atom .avatar-prop::before,
.character-emblem-atom .avatar-prop::after {
  content: "";
  position: absolute;
  inset: 6px -4px;
  border: 2px solid rgba(31, 42, 46, 0.62);
  border-radius: 999px;
}

.character-emblem-atom .avatar-prop::after {
  transform: rotate(58deg);
}

.character-emblem-flag .avatar-prop {
  width: 34px;
  height: 26px;
  border-radius: 2px 10px 10px 2px;
}

.character-emblem-flag .avatar-prop::before,
.character-emblem-lamp .avatar-prop::before,
.character-emblem-kite .avatar-prop::before,
.character-emblem-tool .avatar-prop::before,
.character-emblem-brush .avatar-prop::before,
.character-emblem-compass .avatar-prop::before {
  content: "";
  position: absolute;
  left: -8px;
  bottom: -18px;
  width: 4px;
  height: 24px;
  background: rgba(31, 42, 46, 0.72);
}

.character-emblem-spark .avatar-prop,
.character-emblem-star .avatar-prop {
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 80% 94%, 50% 70%, 20% 94%, 32% 56%, 2% 35%, 39% 35%);
}

.character-emblem-lamp .avatar-prop {
  border-radius: 18px 18px 8px 8px;
}

.character-emblem-leaf .avatar-prop {
  border-radius: 90% 10% 90% 10%;
  transform: rotate(-18deg);
}

.character-emblem-sun .avatar-prop {
  border-radius: 999px;
  box-shadow:
    0 -12px 0 -8px var(--char-accent),
    0 12px 0 -8px var(--char-accent),
    12px 0 0 -8px var(--char-accent),
    -12px 0 0 -8px var(--char-accent);
}

.character-emblem-kite .avatar-prop {
  transform: rotate(45deg);
}

.character-emblem-book .avatar-prop {
  width: 32px;
  height: 26px;
  border-radius: 4px 10px 10px 4px;
}

.character-emblem-shield .avatar-prop {
  clip-path: polygon(50% 0, 92% 16%, 82% 70%, 50% 100%, 18% 70%, 8% 16%);
}

.character-emblem-heart .avatar-prop {
  transform: rotate(-45deg);
  border-radius: 8px;
}

.character-emblem-heart .avatar-prop::before,
.character-emblem-heart .avatar-prop::after {
  content: "";
  position: absolute;
  width: 26px;
  aspect-ratio: 1;
  background: var(--char-accent);
  border: 3px solid rgba(31, 42, 46, 0.76);
  border-radius: 999px;
}

.character-emblem-heart .avatar-prop::before {
  left: -3px;
  top: -15px;
}

.character-emblem-heart .avatar-prop::after {
  right: -15px;
  top: -3px;
}

.character-emblem-tool .avatar-prop {
  width: 14px;
  height: 38px;
  border-radius: 999px;
  transform: rotate(38deg);
}

.character-emblem-brush .avatar-prop {
  width: 16px;
  height: 38px;
  border-radius: 999px 999px 4px 4px;
  transform: rotate(28deg);
}

.character-emblem-bolt .avatar-prop {
  clip-path: polygon(48% 0, 88% 0, 62% 42%, 92% 42%, 35% 100%, 46% 56%, 16% 56%);
}

.character-emblem-chart .avatar-prop {
  width: 34px;
  height: 28px;
  border-radius: 4px;
}

.character-emblem-compass .avatar-prop {
  border-radius: 999px;
}

.character-emblem-compass .avatar-prop::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 5px;
  width: 7px;
  height: 16px;
  background: rgba(31, 42, 46, 0.72);
  clip-path: polygon(50% 0, 100% 100%, 50% 74%, 0 100%);
}

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

.result-guidance {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.guidance-card {
  padding: 16px;
  border: 1px solid rgba(27, 127, 121, 0.22);
  background: rgba(27, 127, 121, 0.08);
}

.guidance-label {
  display: block;
  margin-bottom: 8px;
  color: var(--teal-deep);
  font-size: 0.84rem;
  font-weight: 820;
}

.guidance-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.quality-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.quality-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  display: grid;
  gap: 8px;
}

.quality-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
}

.quality-value {
  color: var(--teal-deep);
  font-size: 1.7rem;
  font-weight: 860;
  line-height: 1;
}

.quality-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.dimension-row {
  display: grid;
  gap: 10px;
}

.dimension-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.dimension-name {
  color: var(--ink);
  font-weight: 780;
}

.meter {
  position: relative;
  height: 18px;
  background: #eadfce;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  min-width: 4%;
  background: var(--blue);
}

.meter-fill.is-right {
  margin-left: auto;
  background: var(--coral);
}

.result-actions {
  margin-top: auto;
  padding-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.result-actions .fine-print {
  flex-basis: 100%;
  margin-top: 16px;
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .brand-panel,
  .test-panel {
    min-height: auto;
    padding: 28px;
  }

  .brand-panel {
    grid-template-columns: 1fr minmax(170px, 260px);
    align-items: center;
  }

  .type-visual {
    width: 100%;
  }

  .view.is-active {
    min-height: 480px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1160px);
    padding: 10px 0;
    gap: 10px;
  }

  .brand-panel,
  .test-panel {
    padding: 22px;
  }

  .brand-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  h1 {
    font-size: 3.1rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .start-grid,
  .quiz-top {
    grid-template-columns: 1fr;
  }

  .mode-picker,
  .quality-results,
  .type-character {
    grid-template-columns: 1fr;
  }

  .type-character {
    justify-items: center;
    text-align: center;
  }

  .ghost-action {
    order: -1;
  }

  .primary-action {
    width: 100%;
  }

  .secondary-action {
    width: 100%;
  }

  .dimension-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .dimension-strip span {
    min-height: 68px;
  }

  .dimension-meta {
    display: grid;
  }

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

  .answer-list.is-fun-scale {
    grid-template-columns: 1fr;
  }

  .answer-button {
    min-height: 54px;
    grid-template-columns: 18px 1fr;
    justify-items: start;
    gap: 12px;
    text-align: left;
    padding: 14px 16px;
  }

  .answer-button::before {
    margin-bottom: 0;
  }

  .scale-guide {
    display: none;
  }
}
