:root {
  --ink: #111215;
  --paper: #f4efe5;
  --paper-soft: #fffaf0;
  --blue: #1294ee;
  --green: #29c777;
  --yellow: #f2c84b;
  --orange: #ff7a3d;
  --red: #e4524d;
  --line: rgba(17, 18, 21, 0.16);
  --shadow: 0 26px 80px rgba(17, 18, 21, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 18, 21, 0.04) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(17, 18, 21, 0.04) 1px, transparent 1px) 0 0 / 34px 34px,
    var(--paper);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0 44px;
  display: grid;
  gap: 28px;
}

.quiz-panel {
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 30px;
}

.brand-logo {
  width: 220px;
  height: auto;
  display: block;
  padding: 12px;
  background: #111215;
  border-radius: 6px;
}

.course-tag {
  border: 1px solid var(--ink);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--paper-soft);
  box-shadow: 5px 5px 0 var(--ink);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  padding: 26px 0 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(42px, 8vw, 104px);
  line-height: 0.96;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.live-score {
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 50%;
  border: 8px solid var(--blue);
  box-shadow: 10px 10px 0 var(--yellow);
  font-family: Georgia, "Times New Roman", serif;
}

.live-score span {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
}

.live-score small {
  margin-left: 2px;
  font-size: 18px;
}

.question-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.question-card {
  min-inline-size: 0;
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 6px 6px 0 rgba(17, 18, 21, 0.16);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 420px);
  gap: 12px 22px;
  align-items: center;
}

.question-card h2 {
  margin: 0;
  font-size: clamp(18px, 2.6vw, 28px);
  font-weight: 900;
  line-height: 1.25;
}

.question-card h2 span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.question-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(17, 18, 21, 0.68);
  font-size: 14px;
  font-weight: 700;
}

.score-row {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(42px, 1fr));
  gap: 8px;
}

.score-option {
  min-width: 0;
  min-height: 50px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.score-option:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.score-option[aria-checked="true"] {
  color: var(--paper-soft);
  background: var(--blue);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.32), 4px 4px 0 var(--ink);
}

.result-button {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  color: var(--paper-soft);
  background: var(--ink);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 8px 8px 0 var(--blue);
  transition: transform 150ms ease, opacity 150ms ease;
}

.result-button:not(:disabled):hover {
  transform: translate(-2px, -2px);
}

.result-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.result-stage {
  padding: 12px 0 34px;
}

.share-card {
  position: relative;
  overflow: hidden;
  width: min(640px, 100%);
  min-height: 820px;
  margin: 0 auto;
  padding: 28px;
  color: #fbf7ec;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    #111215;
  border: 3px solid #111215;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.share-card::before {
  content: "";
  position: absolute;
  inset: auto -8% 7% auto;
  width: 38%;
  aspect-ratio: 1;
  border: 30px solid currentColor;
  border-left-color: transparent;
  transform: rotate(-18deg);
  opacity: 0.08;
}

.share-card[data-level="foundation"] {
  --accent: var(--orange);
  --accent-2: var(--red);
}

.share-card[data-level="loop"] {
  --accent: var(--yellow);
  --accent-2: var(--green);
}

.share-card[data-level="agent"] {
  --accent: var(--green);
  --accent-2: var(--blue);
}

.report-head,
.share-card footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.report-head img {
  width: 188px;
  height: auto;
}

.report-head span,
.share-card footer {
  color: rgba(251, 247, 236, 0.68);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.score-lockup {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 58px 0 26px;
}

.score-lockup p {
  margin: 0 0 12px;
  color: rgba(251, 247, 236, 0.74);
  font-size: 18px;
  font-weight: 800;
}

.score-lockup strong {
  display: block;
  max-width: 380px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(44px, 10vw, 80px);
  line-height: 0.95;
  letter-spacing: 0;
  text-wrap: balance;
}

.score-ring {
  width: 146px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #111215;
  background: var(--accent);
  border: 8px solid #fbf7ec;
  border-radius: 50%;
  box-shadow: 10px 10px 0 var(--accent-2);
  font-family: Georgia, "Times New Roman", serif;
}

.score-ring span {
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
}

.score-ring small {
  margin-top: -28px;
  font-size: 18px;
  font-weight: 900;
}

.result-line {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 22px 0 24px;
  border-top: 2px solid rgba(251, 247, 236, 0.22);
  border-bottom: 2px solid rgba(251, 247, 236, 0.22);
  font-size: clamp(22px, 4.8vw, 34px);
  font-weight: 900;
  line-height: 1.25;
}

.identity-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 0;
  margin: 26px 0;
  color: #111215;
  background: #fbf7ec;
  border-left: 12px solid var(--accent);
}

.identity-grid div {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid rgba(17, 18, 21, 0.12);
}

.identity-grid div:last-child {
  border-right: 0;
}

.identity-grid span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 900;
}

.identity-grid strong {
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.mini-bars {
  position: relative;
  z-index: 1;
  display: none;
  gap: 10px;
  margin: 0 0 26px;
}

.mini-bar {
  display: grid;
  grid-template-columns: 112px 1fr 24px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
}

.mini-bar span:first-child {
  color: rgba(251, 247, 236, 0.74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track {
  height: 12px;
  background: rgba(251, 247, 236, 0.18);
  border: 1px solid rgba(251, 247, 236, 0.28);
}

.fill {
  height: 100%;
  width: calc(var(--value) * 20%);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.next-card {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding: 20px;
  color: #111215;
  background: var(--accent);
  border-radius: 8px;
}

.next-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 900;
}

.next-card p {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}

.share-card footer {
  margin-top: 34px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.result-actions button {
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 12px 18px;
  background: var(--paper-soft);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 14px;
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 560px);
    padding-top: 18px;
  }

  .topbar,
  .intro-grid,
  .score-lockup,
  .report-head,
  .share-card footer {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .brand-logo {
    width: 182px;
  }

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

  .live-score {
    width: 92px;
    border-width: 6px;
    box-shadow: 7px 7px 0 var(--yellow);
  }

  h1 {
    max-width: 100%;
    font-size: clamp(38px, 13vw, 58px);
    line-height: 1.02;
  }

  .live-score span {
    font-size: 38px;
  }

  .question-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .score-row {
    width: 100%;
    max-width: 320px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }

  .score-option {
    min-height: 44px;
    font-size: 17px;
  }

  .share-card {
    width: 100%;
    max-width: 366px;
    margin: 0;
    min-height: auto;
    padding: 22px;
  }

  .report-head img {
    width: 176px;
  }

  .report-head span {
    max-width: 92px;
    text-align: right;
  }

  .score-lockup {
    grid-template-columns: 1fr;
    padding-top: 38px;
  }

  .score-ring {
    width: 124px;
  }

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

  .identity-grid div {
    border-right: 0;
    border-bottom: 1px solid rgba(17, 18, 21, 0.12);
  }

  .identity-grid div:last-child {
    border-bottom: 0;
  }

  .mini-bar {
    grid-template-columns: 74px minmax(0, 1fr) 22px;
  }

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