:root {
  --bg: #f5f0e2;
  --panel: rgba(255, 251, 240, 0.9);
  --panel-border: rgba(24, 61, 32, 0.16);
  --text: #142715;
  --muted: #5f6a57;
  --court: #9cc14c;
  --court-deep: #3b6b26;
  --line: #fff7e6;
  --ball: #dff94b;
  --clay: #d17344;
  --shadow: 0 24px 60px rgba(20, 39, 21, 0.16);
  --radius: 24px;
  --radius-sm: 16px;
  --font-main: "Avenir Next", "Trebuchet MS", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --font-head: "Arial Black", "Avenir Next Condensed", "Trebuchet MS",
    "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-main);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 247, 220, 0.8), rgba(245, 240, 226, 0.98)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.25) 0 2px,
      transparent 2px 120px
    ),
    linear-gradient(135deg, #88ba43, #4f7c2a 55%, #d17344 110%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      transparent 0 10%,
      rgba(255, 247, 230, 0.4) 10% 11%,
      transparent 11% 89%,
      rgba(255, 247, 230, 0.36) 89% 90%,
      transparent 90%
    ),
    linear-gradient(
      90deg,
      transparent 0 18%,
      rgba(255, 247, 230, 0.26) 18% 18.6%,
      transparent 18.6% 81.4%,
      rgba(255, 247, 230, 0.26) 81.4% 82%,
      transparent 82%
    );
  pointer-events: none;
  opacity: 0.45;
}

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

.hero {
  padding: 32px 4px 24px;
  animation: slide-up 520ms ease;
}

.hero-kicker,
.step-label {
  margin: 0 0 10px;
  color: var(--court-deep);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
}

.step-label {
  text-transform: uppercase;
}

.hero h1,
.panel h2,
.analysis-card h3,
.score-head h3 {
  font-family: var(--font-head);
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 4.2rem);
  line-height: 0.96;
  max-width: none;
  white-space: nowrap;
}

.hero-copy {
  max-width: 40rem;
  margin: 14px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(20, 39, 21, 0.84);
}

.app-grid {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 24px;
  animation: slide-up 420ms ease;
}

.quiz-panel {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 30px;
  background: rgba(255, 252, 243, 0.96);
  border: 1px solid rgba(59, 107, 38, 0.22);
  box-shadow:
    0 24px 60px rgba(20, 39, 21, 0.16),
    0 0 0 6px rgba(255, 247, 230, 0.3);
}

.panel-head,
.quiz-head,
.result-top,
.score-head,
.quiz-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-head,
.tag-row,
.legend,
.options,
.score-bars,
.analysis-grid {
  display: grid;
  gap: 14px;
}

.pill,
.tag,
.legend-badge,
.option-key,
.score-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
}

.pill {
  padding: 8px 12px;
  background: rgba(59, 107, 38, 0.08);
  color: var(--court-deep);
  font-size: 0.9rem;
}

.intro-copy h2,
.quiz-head h2,
.result-top h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1.02;
}

.quiz-head {
  align-items: flex-start;
  gap: 20px;
}

.quiz-head > div {
  display: grid;
  gap: 12px;
  width: 100%;
}

.quiz-panel .step-label {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(59, 107, 38, 0.1);
  color: var(--court-deep);
  font-size: 0.88rem;
}

.quiz-panel h2 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.16;
  max-width: 14ch;
}

.intro-copy p,
.helper-text,
.result-subtitle,
.result-summary,
.analysis-card p,
.score-head p {
  color: var(--muted);
  line-height: 1.7;
}

.legend {
  margin-top: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  min-height: 68px;
}

.legend-badge {
  width: 38px;
  height: 38px;
  color: #102110;
}

.badge-a {
  background: #effbc0;
}

.badge-b {
  background: #ffc99f;
}

.badge-c {
  background: #bcefe2;
}

.badge-d {
  background: #e7d0ff;
}

.primary-button,
.ghost-button,
.option-button {
  border: 0;
  font: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-button,
.ghost-button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--court-deep);
  color: #f8ffe9;
  box-shadow: 0 14px 28px rgba(59, 107, 38, 0.26);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  border: 1px solid rgba(20, 39, 21, 0.12);
}

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

.quiz-panel .options {
  margin-top: 22px;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

.option-button {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 94px;
  padding: 18px 20px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(20, 39, 21, 0.1);
  box-shadow: 0 12px 26px rgba(20, 39, 21, 0.07);
}

.option-button.selected {
  border-color: rgba(59, 107, 38, 0.42);
  background: linear-gradient(180deg, rgba(244, 253, 217, 0.95), rgba(235, 249, 191, 0.92));
  box-shadow: 0 16px 32px rgba(59, 107, 38, 0.16);
}

.option-key {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, #ecff88, #d7f04c);
  color: #152500;
  font-size: 1rem;
  box-shadow: inset 0 -4px 10px rgba(21, 37, 0, 0.08);
}

.option-ghost {
  width: 46px;
  height: 46px;
  visibility: hidden;
}

.option-copy strong,
.analysis-card h3,
.score-label,
.tag {
  display: block;
}

.option-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  text-align: center;
}

.option-copy strong {
  font-size: clamp(1.02rem, 2.4vw, 1.14rem);
  line-height: 1.55;
  font-weight: 800;
  max-width: 22ch;
}

.quiz-panel .option-copy strong {
  max-width: none;
}

.option-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.helper-text {
  margin: 0;
  font-size: 0.92rem;
  text-align: center;
}

.quiz-footer {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.quiz-footer .helper-text {
  margin-left: auto;
}

.hidden {
  display: none;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.result-image-wrap {
  position: relative;
  min-height: 420px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(58, 109, 37, 0.94), rgba(214, 116, 68, 0.92)),
    linear-gradient(180deg, transparent 0 8%, rgba(255, 247, 230, 0.24) 8% 9%, transparent 9%);
}

.result-image-wrap::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(255, 247, 230, 0.44);
  border-radius: 16px;
  pointer-events: none;
}

.result-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-summary {
  margin-top: 0;
  font-size: 1.04rem;
}

.tag-row {
  grid-template-columns: repeat(3, minmax(0, max-content));
  margin: 18px 0;
}

.tag {
  padding: 10px 14px;
  background: rgba(235, 249, 191, 0.8);
  color: #26461b;
  border-radius: 999px;
  font-size: 0.92rem;
}

.analysis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-card {
  min-height: 138px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.analysis-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.analysis-card p {
  margin: 0;
}

.score-panel {
  margin-top: 22px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.score-bars {
  margin-top: 16px;
}

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

.score-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(20, 39, 21, 0.08);
}

.score-fill {
  height: 100%;
  border-radius: inherit;
}

.score-letter {
  width: 36px;
  height: 36px;
  justify-self: center;
}

.progress-track {
  margin-top: 18px;
  height: 18px;
  padding: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(20, 39, 21, 0.08);
  box-shadow: inset 0 1px 2px rgba(20, 39, 21, 0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b6b26, #79aa35 45%, #dff94b 100%);
  transition: width 240ms ease;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.creator-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  background: rgba(24, 61, 32, 0.94);
  color: #fff7e6;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(24, 61, 32, 0.2);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.creator-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(24, 61, 32, 0.24);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .result-layout,
  .analysis-grid,
  .legend,
  .options {
    grid-template-columns: 1fr;
  }

  .result-image-wrap {
    min-height: 360px;
  }

  .quiz-head,
  .result-top,
  .quiz-footer,
  .score-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .quiz-panel {
    padding: 24px;
  }

  .quiz-panel h2 {
    max-width: none;
  }

  .quiz-footer .helper-text {
    margin-left: 0;
  }

  .tag-row {
    grid-template-columns: repeat(2, minmax(0, max-content));
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .quiz-panel {
    padding: 18px;
  }

  .result-image-wrap {
    min-height: 300px;
  }

  .option-button {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    min-height: 90px;
    padding: 16px;
    border-radius: 20px;
  }

  .option-key,
  .option-ghost {
    width: 40px;
    height: 40px;
  }

  .quiz-panel h2 {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .score-row {
    grid-template-columns: 52px minmax(0, 1fr) 36px;
    gap: 10px;
  }

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