:root {
  --bg: #f7f2e9;
  --card: #fffaf2;
  --text: #2c2c2a;
  --muted: #6f6a61;
  --soft: #eee6d8;
  --line: #e1d7c7;
  --primary: #534ab7;
  --primary-dark: #3c3489;
  --primary-soft: #eeedfe;
  --green: #0f6e56;
  --green-soft: #e1f5ee;
  --amber: #854f0b;
  --amber-soft: #faeeda;
  --red: #a32d2d;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top left, #eeedfe 0, transparent 34%), var(--bg);
  color: var(--text);
}

button, textarea {
  font: inherit;
}

.app {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 32px 18px 54px;
}

.card {
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(67, 55, 36, 0.08);
}

.hero {
  padding: 46px 36px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: -80px;
  top: -90px;
  border-radius: 50%;
  background: #e1f5ee;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.kicker {
  display: inline-flex;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 14px;
}

h1 {
  margin: 22px 0 12px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -2px;
}

.subtitle {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  background: var(--primary);
}

.btn.secondary {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.btn.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.feature {
  padding: 20px;
}

.feature-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-text {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

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

.progress-wrap {
  flex: 1;
  height: 12px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.question-card {
  padding: 30px;
}

.question-title {
  color: var(--primary-dark);
  font-size: 16px;
  margin-bottom: 10px;
}

.question-scene {
  font-size: 25px;
  line-height: 1.55;
  font-weight: 700;
  margin-bottom: 22px;
}

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

.binary-options {
  grid-template-columns: repeat(2, 1fr);
}

.option {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  width: 100%;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--text);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.option-letter {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.option.active .option-letter {
  background: var(--primary);
  color: #fff;
}

.other-box {
  margin-top: 14px;
}

textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  outline: none;
  background: #fffdf8;
  color: var(--text);
}

.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.result-hero {
  padding: 34px;
  margin-bottom: 18px;
}

.result-label {
  color: var(--muted);
}

.type {
  margin-top: 8px;
  font-size: clamp(54px, 11vw, 104px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 4px;
}

.desc {
  margin-top: 18px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.8;
}

.pill {
  display: inline-flex;
  margin-top: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 14px;
}

.section {
  padding: 26px;
  margin-bottom: 18px;
}

.section h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.dim {
  margin-top: 20px;
}

.dim:first-child {
  margin-top: 0;
}

.dim-head, .dim-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dim-head {
  font-weight: 700;
}

.dim-bar {
  height: 14px;
  margin: 12px 0 10px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.dim-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.dim-note, .evidence-text, .small-note {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.evidence {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.evidence:first-child {
  border-top: none;
  padding-top: 0;
}

.evidence-title {
  font-weight: 700;
  margin-bottom: 5px;
}

.analysis-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
  padding: 18px;
  margin-top: 14px;
}

.analysis-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 10px;
}

.analysis-scene {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 12px;
}

.analysis-block {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
  margin-top: 8px;
}

.analysis-block strong {
  color: var(--primary-dark);
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
  padding: 16px;
  cursor: pointer;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #2c2c2a;
  color: #fff;
  padding: 10px 15px;
  border-radius: 999px;
  font-size: 14px;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 72vh;
  text-align: center;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 5px solid var(--soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 18px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .hero, .question-card, .result-hero, .section {
    padding: 24px 18px;
  }

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

  .question-scene {
    font-size: 21px;
  }

  .binary-options {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
