:root {
  --cream: #fff6df;
  --cream-deep: #ffe8b8;
  --card: rgba(255, 252, 241, 0.94);
  --orange: #f6a531;
  --orange-deep: #e08318;
  --brown: #4f2f19;
  --muted: #8b6b4a;
  --line: #efd8b2;
  --shadow: 0 18px 45px rgba(130, 79, 26, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f8eac4;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--brown);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #fff8df 0%, #ffe8b3 100%);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--cream);
}

.page {
  display: none;
  min-height: 100vh;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.page.is-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.page-cover {
  padding: 18px;
  background: #fff0c6;
}

.cover-card {
  display: flex;
  min-height: calc(100vh - 36px);
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.cover-image {
  width: 100%;
  max-height: calc(100vh - 112px);
  border-radius: 22px;
  object-fit: contain;
  background: #fff8e9;
  box-shadow: var(--shadow);
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
  color: #fffaf0;
  background: linear-gradient(180deg, #ffb948 0%, var(--orange-deep) 100%);
  box-shadow: 0 10px 20px rgba(224, 131, 24, 0.26);
}

.secondary-button {
  color: var(--brown);
  background: #fff8e6;
  border: 1px solid var(--line);
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.98);
}

.page-form,
.page-result {
  padding: 18px 14px 26px;
  background-color: #ffeec5;
  background-image: linear-gradient(rgba(255, 247, 224, 0.72), rgba(255, 238, 197, 0.82)), url("images/底纹.png");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}

.survey-card,
.result-card {
  width: 100%;
  padding: 20px 16px;
  border: 1px solid rgba(255, 229, 181, 0.8);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
}

.form-header,
.result-card {
  text-align: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--orange-deep);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  color: var(--brown);
  font-size: 24px;
  line-height: 1.22;
}

.form-header p:not(.eyebrow),
.result-intro,
.wechat-tip {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.wechat-tip {
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff2cb;
  color: #714416;
}

.question {
  margin: 18px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px dashed #efcf99;
}

legend {
  width: 100%;
  padding: 0;
  color: var(--brown);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
  text-align: left;
}

.hint {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

.option-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

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

.text-option,
.image-option {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #fffaf0;
  color: var(--brown);
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(130, 79, 26, 0.08);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.text-option {
  padding: 12px 13px;
  line-height: 1.45;
  text-align: left;
}

.text-option input,
.image-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.text-option span {
  display: block;
}

.text-option:has(input:checked),
.image-option:has(input:checked),
.text-option.is-selected,
.image-option.is-selected {
  border-color: var(--orange);
  background: #fff2c4;
  box-shadow: 0 10px 22px rgba(224, 131, 24, 0.16);
}

.text-option:active,
.image-option:active {
  transform: scale(0.99);
}

.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.image-option {
  min-width: 0;
  flex-direction: column;
  gap: 9px;
  padding: 9px 9px 12px;
  text-align: center;
}

.image-option img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 13px;
  object-fit: cover;
  background: #fff4d9;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.image-option > span:last-child {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.check-mark {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 7px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.image-option:has(input:checked) .check-mark,
.image-option.is-selected .check-mark {
  opacity: 1;
  transform: scale(1);
}

.text-card {
  margin-top: 12px;
}

textarea {
  width: 100%;
  margin-top: 12px;
  padding: 13px 14px;
  resize: vertical;
  border: 2px solid #f0d3a7;
  border-radius: 16px;
  outline: none;
  background: #fffaf0;
  color: var(--brown);
  line-height: 1.6;
}

textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(246, 165, 49, 0.13);
}

.submit-button {
  margin-top: 22px;
}

.summary-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  background: #fffaf0;
  border: 1px solid var(--line);
  text-align: left;
}

.summary-box h2 {
  margin: 0 0 10px;
  color: var(--brown);
  font-size: 17px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #5a351d;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.75;
}

.result-actions {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 28px;
  max-width: min(360px, calc(100vw - 42px));
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(79, 47, 25, 0.92);
  color: #fffdf8;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 360px) {
  .compact-list,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .survey-card,
  .result-card {
    padding: 18px 13px;
  }
}
