:root {
  color-scheme: light;
  --paper: #f8f3e8;
  --paper-deep: #efe1c4;
  --ink: #1f2320;
  --muted: #69645b;
  --line: rgba(43, 35, 25, .14);
  --red: #a8322d;
  --red-dark: #7f221e;
  --jade: #23685c;
  --gold: #bd8a32;
  --blue: #29486f;
  --white: #fffdf8;
  --shadow: 0 18px 42px rgba(54, 36, 19, .13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(189, 138, 50, .18), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(35, 104, 92, .16), transparent 24rem),
    linear-gradient(160deg, #fbf7ed 0%, #f4e8d2 48%, #edf2ed 100%);
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(168, 50, 45, .28);
  background: var(--white);
  color: var(--red);
  font-weight: 800;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(70, 45, 22, .08);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.view {
  display: none;
}

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

.intro {
  min-height: calc(100vh - 120px);
  display: none;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 48px;
  padding: 22px 0 36px;
}

.intro.is-active {
  display: grid;
}

.eyebrow,
.question-kicker {
  margin: 0 0 12px;
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
}

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

h1 {
  max-width: 740px;
  margin-bottom: 18px;
  font-size: clamp(42px, 8vw, 82px);
  line-height: 1.04;
  font-weight: 900;
}

.lead {
  max-width: 650px;
  color: #514c44;
  font-size: 19px;
  line-height: 1.8;
}

.intro-actions,
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-button,
.ghost-button,
.link-button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  background: var(--red);
  color: #fff;
  box-shadow: 0 12px 26px rgba(168, 50, 45, .24);
  font-weight: 800;
}

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

.ghost-button,
.link-button {
  background: rgba(255, 253, 248, .72);
  color: var(--ink);
  border-color: var(--line);
}

.compass-panel {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
}

.compass-ring {
  width: min(82vw, 390px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  padding: 18px;
  border-radius: 50%;
  border: 1px solid rgba(35, 104, 92, .25);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .9), rgba(239, 225, 196, .76)),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(35, 104, 92, .06) 10px 11px);
  box-shadow: var(--shadow);
}

.compass-ring span,
.compass-ring strong {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(43, 35, 25, .1);
  background: rgba(255, 253, 248, .78);
  color: var(--jade);
  border-radius: 8px;
  font-size: 24px;
  font-weight: 800;
}

.compass-ring strong {
  color: var(--red);
  font-size: 56px;
  background: #fffaf0;
}

.quiz {
  max-width: 820px;
  margin: 56px auto 0;
}

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

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

.progress-track {
  height: 10px;
  background: rgba(255, 253, 248, .76);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-track div {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--jade));
  transition: width .25s ease;
}

.question-block,
.result-summary,
.route-panel,
.share-zone {
  background: rgba(255, 253, 248, .82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.question-block {
  padding: clamp(22px, 5vw, 40px);
}

.question-block h2 {
  margin-bottom: 24px;
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.25;
}

.choices {
  display: grid;
  gap: 12px;
}

.choice-button {
  width: 100%;
  min-height: 66px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid rgba(43, 35, 25, .13);
  background: #fffaf1;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.choice-button:hover,
.choice-button.is-selected {
  border-color: rgba(168, 50, 45, .38);
  box-shadow: 0 10px 22px rgba(100, 60, 20, .1);
}

.choice-button strong {
  font-size: 17px;
}

.choice-button span {
  color: var(--muted);
  line-height: 1.6;
}

.quiz-nav {
  margin-top: 18px;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.result-summary,
.route-panel {
  padding: clamp(20px, 4vw, 30px);
}

.result-summary h2 {
  margin-bottom: 18px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.14;
}

.score-line {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--red);
}

.score-line strong {
  font-size: clamp(58px, 10vw, 92px);
  line-height: .9;
}

.score-line span {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.level-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  margin: -4px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(189, 138, 50, .22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(189, 138, 50, .13), rgba(35, 104, 92, .09));
}

.level-card span {
  grid-row: span 2;
  min-width: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.level-card strong {
  color: var(--ink);
  font-size: 18px;
}

.level-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.55;
}

.result-summary p,
.route-panel li,
.share-copy p {
  color: #4e4941;
  line-height: 1.8;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tag-row span {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(35, 104, 92, .1);
  color: var(--jade);
  font-weight: 700;
  font-size: 14px;
}

.route-panel h3,
.share-zone h3 {
  margin-bottom: 14px;
  font-size: 22px;
}

.route-panel ol {
  margin: 0 0 20px 22px;
  padding: 0;
}

.route-panel li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.resource-links {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.resource-links h4 {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 17px;
}

.resource-item {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.resource-item a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.45;
}

.resource-item a:hover {
  text-decoration: underline;
}

.resource-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.keyword-row a {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(41, 72, 111, .18);
  background: rgba(41, 72, 111, .07);
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.share-zone {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(260px, 390px);
  gap: 22px;
  align-items: center;
  margin-top: 18px;
  padding: clamp(20px, 4vw, 30px);
}

.card-preview {
  display: grid;
  place-items: center;
}

canvas {
  width: min(100%, 340px);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(55, 34, 16, .16);
  background: #f8f3e8;
}

.toast {
  min-height: 26px;
  margin: 12px 0 0;
  color: var(--jade);
  font-weight: 700;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 14px;
  }

  .intro.is-active,
  .result-grid,
  .share-zone {
    grid-template-columns: 1fr;
  }

  .intro {
    gap: 26px;
    align-items: start;
  }

  .compass-panel {
    min-height: 280px;
    order: -1;
  }

  .compass-ring {
    width: min(82vw, 280px);
  }

  .compass-ring span {
    font-size: 18px;
  }

  .compass-ring strong {
    font-size: 42px;
  }

  .lead {
    font-size: 17px;
  }

  .quiz {
    margin-top: 26px;
  }

  .share-actions,
  .intro-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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