:root {
  --bg: #f5faf7;
  --ink: #1f2933;
  --muted: #5c6975;
  --panel: #ffffff;
  --line: #d7e2dd;
  --green: #206a5d;
  --green-soft: #e8f4ef;
  --coral: #e45b6f;
  --yellow: #f2c14e;
  --cyan: #2f9c95;
  --shadow: 0 18px 48px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  background: linear-gradient(135deg, #f5faf7 0%, #eef8f5 52%, #f8fbf8 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.hidden {
  display: none;
}

.visual-start {
  min-height: calc(100vh - 48px);
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #dfeee8;
}

.visual-start img {
  width: 100%;
  height: calc(100vh - 48px);
  min-height: 620px;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
  filter: saturate(0.82) contrast(0.95);
}

.visual-start::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 43, 39, 0.76), rgba(13, 43, 39, 0.40) 52%, rgba(13, 43, 39, 0.10));
  pointer-events: none;
}

.visual-copy {
  position: absolute;
  left: 32px;
  bottom: 32px;
  z-index: 1;
  width: min(680px, calc(100% - 64px));
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: 46px;
  line-height: 1.12;
}

h2 {
  font-size: 28px;
  line-height: 1.2;
}

h3 {
  font-size: 22px;
  line-height: 1.35;
}

.visual-copy p:not(.eyebrow) {
  width: min(620px, 100%);
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.75;
}

.primary,
.secondary {
  min-height: 44px;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 12px 26px rgba(228, 91, 111, 0.28);
}

.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

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

#startBtn {
  margin-top: 26px;
}

.test-view,
.result-view {
  animation: viewIn 260ms ease both;
}

.top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.counter {
  min-width: 88px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
  text-align: center;
}

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

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--coral));
  transition: width 260ms ease;
}

.question-stage {
  min-height: 380px;
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(32, 106, 93, 0.08), rgba(228, 91, 111, 0.08)),
    var(--panel);
  box-shadow: var(--shadow);
}

.question-stage.is-switching {
  animation: questionSwap 220ms ease both;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.question-meta span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

#questionTitle {
  max-width: 860px;
  min-height: 70px;
}

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

.option-button {
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.option-button strong {
  display: block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 18px;
}

.option-button span {
  color: var(--muted);
  line-height: 1.55;
}

.option-button:hover,
.option-button.is-selected {
  transform: translateY(-2px);
  border-color: var(--green);
  background: var(--green-soft);
}

.option-button.is-selected {
  box-shadow: inset 0 0 0 2px rgba(32, 106, 93, 0.24);
}

.question-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.nav-hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

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

.mini-dot {
  height: 8px;
  border-radius: 8px;
  background: #dce7e2;
  border: 0;
  padding: 0;
}

.mini-dot.is-active {
  background: var(--coral);
}

.mini-dot.is-done {
  background: var(--green);
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.result-summary,
.candidate-panel,
.dimension-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.result-summary,
.candidate-panel {
  padding: 24px;
}

.type-code {
  display: inline-flex;
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
}

#resultDesc {
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.result-note {
  margin-top: 18px;
  border-left: 4px solid var(--coral);
  padding-left: 12px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.7;
}

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

.candidate-tab {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.candidate-tab.is-active {
  border-color: var(--green);
  background: var(--green-soft);
}

.candidate-tab span {
  color: var(--green);
  font-weight: 900;
}

.dimension-panel {
  margin-top: 16px;
  padding: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head p {
  max-width: 460px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

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

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

.dimension-name {
  font-weight: 800;
}

.dimension-track {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #e1ebe6;
}

.dimension-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
  transition: width 520ms ease;
}

.dimension-score {
  color: var(--muted);
  text-align: right;
  font-size: 13px;
}

@keyframes viewIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes questionSwap {
  from {
    transform: translateX(14px);
    opacity: 0.4;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 10px 0 40px;
  }

  .visual-start,
  .visual-start img {
    min-height: 620px;
  }

  .visual-copy {
    left: 18px;
    bottom: 22px;
    width: calc(100% - 36px);
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 24px;
  }

  .top-line,
  .question-nav,
  .result-grid,
  .panel-head {
    display: block;
  }

  .counter,
  .question-nav .primary,
  .question-nav .secondary {
    margin-top: 14px;
  }

  .question-stage {
    min-height: 0;
    padding: 18px;
  }

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

  .option-button {
    min-height: 78px;
  }

  .nav-hint {
    margin: 12px 0;
    text-align: left;
  }

  .result-summary,
  .candidate-panel,
  .dimension-panel {
    padding: 18px;
  }

  .candidate-panel {
    margin-top: 16px;
  }

  .dimension-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

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