:root {
  --bg: #1a1520;
  --surface: #241e2a;
  --surface-strong: #2d2535;
  --ink: #efe8f7;
  --muted: #9d90ad;
  --line: #3a3045;
  --gold: #f0c060;
  --orange: #e87d3e;
  --purple: #b89fff;
  --green: #6fcf97;
  --blue: #80b4ff;
  --red: #f87171;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(232, 125, 62, 0.06), transparent 36%),
    linear-gradient(315deg, rgba(184, 159, 255, 0.07), transparent 42%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(110px, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 58px;
  margin-bottom: 24px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(26, 21, 32, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(240, 192, 96, 0.46);
  border-radius: 8px;
  background: #17111d;
  color: var(--gold);
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  line-height: 1.1;
  white-space: nowrap;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
}

.nav-tabs {
  display: inline-flex;
  justify-self: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1f1827;
}

.nav-tab {
  min-width: 66px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.nav-tab.is-active {
  background: var(--surface-strong);
  color: var(--gold);
}

.view {
  display: none;
}

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

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.15;
}

.assessment-layout {
  width: min(900px, 100%);
  margin: 0 auto;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(36, 30, 42, 0.88);
  box-shadow: var(--shadow);
}

.button-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button,
.ghost-button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  border: 1px solid rgba(232, 125, 62, 0.62);
  background: var(--orange);
  color: #fff;
  padding: 0 18px;
}

.primary-button:hover {
  background: #d66f33;
}

.primary-button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #3a3045;
  color: var(--muted);
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0 16px;
}

.ghost-button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.full-width {
  width: 100%;
}

.select-control {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1f1827;
  color: var(--ink);
  padding: 0 34px 0 12px;
}

.assessment-panel {
  padding-bottom: 6px;
}

.question-list {
  display: grid;
  gap: 12px;
  padding: 0 18px;
}

.question-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.question-step {
  min-height: 360px;
  align-content: start;
}

.complete-step {
  text-align: left;
}

.completion-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.report-gate-step {
  gap: 16px;
}

.report-gate-frame {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
  border-radius: 8px;
  background: #17111d;
}

.question-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.question-title span {
  flex: 0 0 auto;
  color: var(--gold);
  font-weight: 900;
}

.question-title h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.45;
}

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

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1f1827;
  color: var(--ink);
  text-align: left;
}

.option-card input {
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--orange);
}

.option-card:has(input:checked) {
  border-color: var(--orange);
  background: rgba(232, 125, 62, 0.12);
}

.assessment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.progress-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.result-empty,
.result-filled {
  display: grid;
  gap: 14px;
}

.result-empty h2,
.result-filled h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 40px);
}

.result-empty p,
.result-filled p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.result-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(128, 180, 255, 0.32);
  border-radius: 999px;
  background: rgba(128, 180, 255, 0.1);
  color: var(--blue);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
}

.type-code {
  display: inline-grid;
  width: fit-content;
  min-height: 64px;
  align-items: center;
  margin: 6px 0;
  border: 1px solid rgba(240, 192, 96, 0.42);
  border-radius: 8px;
  background: #17111d;
  color: var(--gold);
  padding: 0 22px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 10px;
}

.dimension-panel {
  display: grid;
  justify-items: center;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(232, 125, 62, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.02);
  padding: 18px;
}

.radar-chart {
  display: block;
  width: min(520px, 100%);
  height: auto;
  overflow: visible;
}

.radar-grid {
  fill: rgba(255, 255, 255, 0.015);
  stroke: rgba(240, 192, 96, 0.2);
  stroke-width: 1;
}

.radar-axis {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.radar-area {
  fill: rgba(232, 125, 62, 0.26);
  stroke: var(--orange);
  stroke-width: 3;
  stroke-linejoin: round;
}

.radar-point {
  fill: var(--orange);
  stroke: #17111d;
  stroke-width: 2;
}

.radar-point.is-dominant {
  fill: var(--gold);
}

.radar-label {
  fill: var(--muted);
  font-weight: 900;
  pointer-events: none;
}

.radar-label.is-dominant {
  fill: var(--gold);
}

.radar-letter {
  font-size: 18px;
}

.radar-score {
  font-size: 11px;
}

.quiz-notice {
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding-top: 14px;
  font-size: 11px;
  text-align: center;
}

.quiz-notice.compact {
  margin-top: 18px;
}

.progress-wrap {
  margin-bottom: 26px;
}

.progress-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #17111d;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  transition: width 220ms ease;
}

.progress-line {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.q-num {
  margin-bottom: 8px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.q-text {
  margin: 0 0 22px;
  font-size: 22px;
  line-height: 1.45;
}

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

.option-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 13px 16px;
  text-align: left;
}

.option-button:hover {
  border-color: var(--orange);
  background: rgba(232, 125, 62, 0.08);
}

.option-button.is-selected {
  border-color: var(--gold);
  background: rgba(240, 192, 96, 0.1);
}

.option-button span {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.option-button:hover span {
  background: var(--orange);
  color: #fff;
}

.back-button {
  display: block;
  min-height: 36px;
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.back-button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #f3e8ff;
  color: #1f1827;
  font-size: 14px;
  font-weight: 900;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .assessment-layout {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 20px, 720px);
    padding-top: 10px;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .brand,
  .nav-tabs {
    justify-self: stretch;
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .dimension-panel {
    padding: 10px;
  }

  .radar-chart {
    width: 100%;
  }

  .section-head,
  .assessment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .type-code {
    min-height: 56px;
    padding: 0 16px;
    font-size: 28px;
    letter-spacing: 7px;
  }

  .question-title {
    align-items: flex-start;
  }
}
