:root {
  color-scheme: light;
  --bg: #f4efe5;
  --bg-strong: #eadcca;
  --surface: rgba(255, 252, 247, 0.72);
  --surface-strong: #fffaf2;
  --ink: #1d160f;
  --muted: #65584c;
  --line: rgba(29, 22, 15, 0.1);
  --accent: #db5b2b;
  --accent-2: #1f7a6b;
  --accent-3: #f3b33d;
  --result-accent: #1f7a6b;
  --shadow: 0 18px 60px rgba(61, 35, 8, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(243, 179, 61, 0.35), transparent 25%),
    radial-gradient(circle at top right, rgba(31, 122, 107, 0.24), transparent 24%),
    linear-gradient(180deg, #f6f0e8 0%, #efe4d6 100%);
  color: var(--ink);
  font-family: var(--font-display);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
  background-size: 12px 12px;
}

.shell {
  position: relative;
  width: min(960px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.lang-switch {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  margin: 0 0 12px auto;
  background: rgba(255, 252, 247, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(29, 22, 15, 0.08);
}

.lang-button {
  min-width: 68px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.lang-button.active {
  background: var(--ink);
  color: #fff;
}

.hero,
.quiz,
.result {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero {
  padding: 44px 24px 28px;
  overflow: hidden;
}

.eyebrow,
.question-tag,
.result-kicker,
.mini-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--muted);
}

h1 {
  margin: 10px 0 14px;
  max-width: 12ch;
  font-size: clamp(44px, 9vw, 88px);
  line-height: 0.92;
}

.hero-copy {
  max-width: 32rem;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-cards,
.result-grid,
.chip-row,
.hero-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-cards {
  margin-top: 28px;
}

.mini-card,
.panel,
.question-card,
.result-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.mini-card {
  min-width: 120px;
  padding: 16px 18px;
}

.mini-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.hero-actions {
  margin-top: 28px;
}

.mode-switch {
  display: inline-flex;
  gap: 6px;
  margin-top: 18px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(29, 22, 15, 0.06);
}

.mode-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.mode-button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 10px rgba(29, 22, 15, 0.08);
}

.avatar-showcase {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding: 10px 0 4px;
  overflow: hidden;
}

.avatar-showcase img {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 20px;
  border: 1px solid rgba(29, 22, 15, 0.08);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 18px rgba(29, 22, 15, 0.08);
}

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

.primary-button,
.ghost-button,
.text-button,
.option-button {
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.primary-button,
.ghost-button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

.primary-button {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 24px rgba(29, 22, 15, 0.18);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
  border: 1px solid var(--line);
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--muted);
}

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

.disclaimer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.hidden {
  display: none;
}

.quiz,
.result {
  padding: 22px;
}

.quiz-top,
.result-head,
.scores-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress-block {
  flex: 1;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.progress-bar {
  height: 10px;
  background: rgba(29, 22, 15, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.question-card {
  margin-top: 18px;
  padding: 24px;
}

.question-card h2 {
  margin: 8px 0 0;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.08;
}

.option-list {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.option-button {
  width: 100%;
  padding: 18px;
  text-align: left;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 10px 24px rgba(29, 22, 15, 0.05);
}

.option-button strong {
  display: block;
  font-size: 18px;
  position: relative;
  z-index: 2;
}

.option-button span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  position: relative;
  z-index: 2;
}

.option-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 18%, rgba(255, 255, 255, 0.75) 30%, transparent 42%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--badge-color, #db5b2b) 14%, white), transparent 34%);
  transform: translateX(-42%);
  opacity: 0.72;
  z-index: 0;
  animation: option-sheen 4.8s ease-in-out infinite;
}

.option-button::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  top: 16px;
  right: 18px;
  border-radius: 999px;
  background: var(--badge-color, #db5b2b);
  opacity: 0.26;
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--badge-color, #db5b2b) 12%, transparent),
    0 0 28px color-mix(in srgb, var(--badge-color, #db5b2b) 48%, transparent);
  z-index: 1;
  animation: option-pulse 2.6s ease-in-out infinite;
}

.option-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.option-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--badge-color, #db5b2b) 16%, white);
  color: var(--badge-color, #db5b2b);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
  animation: option-float 2.9s ease-in-out infinite;
}

.option-button.selected {
  background: #fff2db;
  border-color: rgba(219, 91, 43, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(219, 91, 43, 0.12),
    0 14px 30px rgba(219, 91, 43, 0.12);
  transform: translateY(-2px) scale(1.01);
}

.option-button.selected::before {
  opacity: 0.98;
}

.option-button:hover .option-badge,
.option-button.selected .option-badge {
  transform: translateY(-1px) scale(1.04);
}

@keyframes option-sheen {
  0%, 100% {
    transform: translateX(-42%);
  }
  50% {
    transform: translateX(42%);
  }
}

@keyframes option-pulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.24;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.42;
  }
}

@keyframes option-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.panel,
.result-card {
  padding: 22px;
}

.result-card {
  margin-top: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--result-accent) 18%, white), rgba(243, 179, 61, 0.16)),
    var(--surface-strong);
  overflow: hidden;
  position: relative;
}

.result-hero {
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  min-height: 252px;
  position: relative;
}

.result-avatar-image {
  width: min(220px, 58vw);
  height: auto;
  filter: drop-shadow(0 20px 28px rgba(29, 22, 15, 0.12));
  position: relative;
  z-index: 2;
}

.result-aura {
  position: absolute;
  width: min(270px, 72vw);
  aspect-ratio: 1;
  border-radius: 999px;
  z-index: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.92), transparent 28%),
    radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--result-accent) 26%, white), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--result-accent) 24%, white), rgba(243, 179, 61, 0.22));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.66),
    0 18px 32px rgba(29, 22, 15, 0.08);
}

.result-aura::before,
.result-aura::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.result-aura::before {
  inset: 18px;
  border: 1px dashed rgba(29, 22, 15, 0.12);
}

.result-aura::after {
  inset: 52px;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.result-emblem {
  position: absolute;
  top: 18px;
  right: clamp(8px, 6vw, 42px);
  display: grid;
  place-items: center;
  min-width: 62px;
  height: 62px;
  padding: 0 12px;
  border-radius: 18px;
  background: rgba(29, 22, 15, 0.92);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.05em;
  box-shadow: 0 14px 26px rgba(29, 22, 15, 0.14);
  transform: rotate(8deg);
  z-index: 3;
}

.result-emblem[data-style="badge"] {
  border-radius: 999px;
}

.result-emblem[data-style="paper"] {
  background: #fffaf2;
  color: var(--ink);
  border: 2px solid rgba(29, 22, 15, 0.12);
}

.result-emblem[data-style="warn"] {
  background: #db5b2b;
}

.result-emblem[data-style="calm"] {
  background: #536471;
}

.result-emblem[data-style="spark"] {
  background: #73b44a;
}

.result-emblem[data-style="royal"] {
  background: #5b6ee1;
}

.result-qr-float {
  position: absolute;
  left: clamp(0px, 2vw, 16px);
  bottom: 6px;
  width: 84px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(255, 250, 242, 0.94);
  border: 1px solid rgba(29, 22, 15, 0.08);
  box-shadow: 0 10px 18px rgba(29, 22, 15, 0.08);
  backdrop-filter: blur(10px);
  transform: rotate(-5deg);
  z-index: 3;
}

.result-qr-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  background: #fff;
}

.result-qr-caption {
  display: block;
  margin-top: 2px;
  text-align: center;
  color: var(--ink);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.result-link-chip {
  display: none;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(29, 22, 15, 0.12);
  border-radius: 18px;
  pointer-events: none;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--result-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.result-slogan {
  margin: 2px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.result-title {
  margin: 0;
}

#result-title {
  margin: 8px 0 8px;
  font-size: clamp(34px, 7vw, 62px);
  line-height: 0.96;
}

.result-code {
  margin: 0;
  color: var(--result-accent);
  letter-spacing: 0.2em;
  font-weight: 800;
}

.result-summary,
.panel p {
  color: var(--muted);
  line-height: 1.7;
}

.chip-row {
  margin-top: 14px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--result-accent) 12%, white);
  color: var(--result-accent);
  font-size: 14px;
  font-weight: 700;
}

.result-footerline {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(29, 22, 15, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.score-list {
  display: grid;
  gap: 14px;
}

.score-row {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: 12px;
  align-items: center;
}

.score-row label {
  color: var(--muted);
  font-size: 14px;
}

.score-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(29, 22, 15, 0.08);
}

.score-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 960px);
    margin-top: 10px;
  }

  .lang-switch {
    display: flex;
    margin-bottom: 10px;
  }

  .lang-button {
    flex: 1;
  }

  .hero,
  .quiz,
  .result {
    border-radius: 24px;
  }

  .hero {
    padding-top: 30px;
  }

  .avatar-showcase {
    gap: 8px;
  }

  .mode-switch {
    display: flex;
  }

  .mode-button {
    flex: 1;
  }

  .avatar-showcase img {
    width: 64px;
    height: 64px;
  }

  .quiz-top,
  .result-head,
  .scores-head,
  .quiz-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-hero {
    min-height: 222px;
    padding-bottom: 0;
  }

  .result-emblem {
    top: 10px;
    right: 6px;
    min-width: 54px;
    height: 54px;
    font-size: 18px;
  }

  .result-qr-float {
    display: block;
    width: 40px;
    left: auto;
    right: 8px;
    bottom: 8px;
    padding: 0;
    border-radius: 3px;
    transform: rotate(0deg);
    box-shadow: 0 2px 4px rgba(29, 22, 15, 0.03);
    opacity: 0.72;
  }

  .result-link-chip {
    display: none;
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    min-height: 28px;
    padding: 0 10px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 250, 242, 0.95);
    border: 1px solid rgba(29, 22, 15, 0.08);
    color: var(--ink);
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 6px 12px rgba(29, 22, 15, 0.06);
  }

  .result-footerline {
    flex-direction: column;
  }

  .score-row {
    grid-template-columns: 90px 1fr 36px;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
