:root {
  --bg: #f4efe6;
  --panel: rgba(255, 252, 247, 0.86);
  --panel-strong: #fffaf1;
  --line: rgba(46, 67, 48, 0.12);
  --text: #1a261c;
  --muted: #5d685f;
  --accent: #c96d3a;
  --accent-deep: #9f4d22;
  --court: #6c8c52;
  --court-dark: #365031;
  --lime: #d7ea8d;
  --shadow: 0 28px 70px rgba(47, 57, 36, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --max-width: 520px;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(216, 234, 141, 0.9), transparent 26%),
    radial-gradient(circle at bottom left, rgba(201, 109, 58, 0.15), transparent 24%),
    linear-gradient(160deg, #f6f0e7 0%, #ebeadc 48%, #dde8cf 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
}

body::before {
  width: 180px;
  height: 180px;
  right: -42px;
  top: 72px;
  background: rgba(108, 140, 82, 0.13);
}

body::after {
  width: 240px;
  height: 240px;
  left: -70px;
  bottom: 10%;
  background: rgba(201, 109, 58, 0.08);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100vw - 32px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 48px;
  min-height: 100vh;
}

.page-shell.is-welcome {
  padding-top: 18px;
  padding-bottom: 18px;
}

.view {
  display: none;
}

[hidden] {
  display: none !important;
}

.view.is-active {
  display: block;
  animation: rise-in 280ms ease-out;
}

.hero-panel,
.quiz-panel,
.result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  width: 100%;
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 24px 24px;
}

.page-shell.is-welcome .hero-panel.is-active {
  display: flex !important;
  min-height: calc(100dvh - 36px);
}

.hero-top,
.hero-bottom {
  display: grid;
  gap: 10px;
}

.hero-main {
  display: grid;
  gap: 18px;
  align-content: center;
  margin: 24px 0 18px;
}

.hero-copy-group {
  display: grid;
  gap: 0;
}

.hero-preview-card {
  padding: 16px 18px 16px;
  border-radius: 22px;
  border: 1px solid rgba(54, 80, 49, 0.1);
  background:
    linear-gradient(145deg, rgba(215, 234, 141, 0.32), rgba(255, 248, 239, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.hero-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.hero-preview-label,
.hero-preview-code {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-preview-label {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.hero-preview-card h2 {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.05;
}

.hero-preview-code {
  color: var(--court-dark);
  font-size: 16px;
  font-weight: 900;
}

.hero-preview-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.badge,
.eyebrow,
.dimension-hint,
.result-code,
.share-card-label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(54, 80, 49, 0.08);
  color: var(--court-dark);
  font-size: 12px;
  font-weight: 700;
}

.eyebrow,
.dimension-hint,
.share-card-label {
  margin: 16px 0 0;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.hero-author {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

h1 {
  margin-top: 14px;
  max-width: none;
  font-size: clamp(40px, 9vw, 58px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

h1 span {
  display: block;
}

h1 span + span {
  margin-top: 8px;
}

h1 span:nth-child(1) {
  font-size: 0.72em;
  letter-spacing: -0.02em;
}

h1 span:nth-child(2) {
  font-size: 1em;
}

h1 span:nth-child(3) {
  font-size: 0.92em;
  color: var(--accent-deep);
}

.hero-copy,
.disclaimer,
.result-tagline,
.advice-list p,
.share-feedback {
  line-height: 1.6;
}

.hero-copy {
  margin-top: 22px;
  color: var(--muted);
  font-size: 16px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-points span,
.score-chip,
.share-card {
  border: 1px solid var(--line);
}

.hero-points span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

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

.primary-button,
.ghost-button {
  min-height: 56px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  color: #fff9f3;
  background: linear-gradient(135deg, var(--accent) 0%, #da8748 100%);
  box-shadow: 0 16px 30px rgba(201, 109, 58, 0.28);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border: 1px solid var(--line);
}

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

.primary-button:active,
.ghost-button:active,
.option-button:active {
  transform: translateY(0);
}

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

.disclaimer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.quiz-panel {
  min-height: calc(100vh - 72px);
  padding: 18px;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-topbar .ghost-button {
  width: auto;
  min-height: 44px;
  padding: 0 16px;
}

.question-counter {
  font-size: 14px;
  font-weight: 800;
  color: var(--court-dark);
}

.progress-track {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(54, 80, 49, 0.1);
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--court-dark) 0%, var(--accent) 100%);
  transition: width 220ms ease;
}

.question-card {
  margin-top: 18px;
  padding: 24px 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(251, 245, 235, 0.94) 100%);
  border: 1px solid rgba(54, 80, 49, 0.08);
}

.question-card h2 {
  margin-top: 0;
  font-size: clamp(28px, 6vw, 36px);
  line-height: 1.12;
}

.dimension-hint {
  display: none;
}

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

.option-button {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 16px;
  text-align: left;
  background: #fffefa;
  border: 1px solid rgba(54, 80, 49, 0.12);
}

.option-button.is-selected {
  border-color: rgba(201, 109, 58, 0.45);
  background: rgba(255, 244, 234, 0.92);
  box-shadow: 0 18px 32px rgba(201, 109, 58, 0.12);
}

.option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: rgba(54, 80, 49, 0.08);
  color: var(--court-dark);
  font-weight: 900;
}

.option-text {
  font-size: 16px;
  line-height: 1.5;
}

.score-chip-row {
  display: none;
  gap: 12px;
  margin-top: 18px;
}

.score-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
}

.score-chip-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.score-pill {
  min-width: 74px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(54, 80, 49, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.score-pill.is-active {
  background: rgba(108, 140, 82, 0.18);
  color: var(--court-dark);
}

.result-panel {
  padding: 18px;
}

.result-card {
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(249, 243, 233, 0.95) 100%);
  border: 1px solid rgba(54, 80, 49, 0.09);
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.result-header h2 {
  margin-top: 8px;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.04;
}

.result-code {
  margin-top: 10px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--accent-deep);
}

.result-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--court-dark), var(--accent));
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.result-tagline {
  margin-top: 18px;
  color: var(--muted);
  font-size: 16px;
}

.result-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.result-visual-card {
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(54, 80, 49, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 18px 32px rgba(47, 57, 36, 0.06);
  background:
    radial-gradient(circle at 50% 72%, color-mix(in srgb, var(--result-glow, #c96d3a) 18%, transparent) 0%, transparent 50%),
    radial-gradient(circle at 18% 52%, color-mix(in srgb, var(--result-glow, #c96d3a) 8%, transparent) 0%, transparent 38%),
    radial-gradient(circle at 82% 46%, color-mix(in srgb, var(--result-deep, #365031) 10%, transparent) 0%, transparent 34%),
    linear-gradient(90deg, color-mix(in srgb, var(--result-soft, #fff8ef) 88%, white) 0%, rgba(255, 248, 239, 0.96) 18%, rgba(255, 248, 239, 0.96) 82%, color-mix(in srgb, var(--result-soft, #fff8ef) 92%, white) 100%);
}

.result-visual-image {
  display: block;
  width: 84%;
  height: auto;
  margin: 0 auto;
  max-height: 42vh;
  object-fit: contain;
  background: transparent;
  border-radius: 24px;
  -webkit-mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 10%,
    rgba(0, 0, 0, 1) 90%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 10%,
    rgba(0, 0, 0, 1) 90%,
    rgba(0, 0, 0, 0) 100%
  );
}

.info-block,
.share-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
}

.dimension-analysis-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.dimension-analysis-card {
  padding: 14px;
  border: 1px solid rgba(54, 80, 49, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 243, 235, 0.92));
}

.dimension-analysis-top,
.dimension-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dimension-analysis-code {
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dimension-analysis-title {
  font-size: 20px;
  font-weight: 900;
}

.dimension-analysis-bars {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.dimension-bar-track {
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(54, 80, 49, 0.1);
}

.dimension-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--court-dark), var(--accent));
}

.dimension-bar-fill.is-secondary {
  background: linear-gradient(90deg, rgba(201, 109, 58, 0.72), rgba(108, 140, 82, 0.55));
}

.dimension-bar-label,
.dimension-bar-value {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.dimension-bar-label {
  width: 28px;
}

.dimension-bar-value {
  min-width: 46px;
  text-align: right;
}

.dimension-analysis-copy {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.info-block h3,
.share-card h3 {
  font-size: 18px;
}

.info-block ul {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.advice-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.share-card {
  background: linear-gradient(145deg, rgba(215, 234, 141, 0.34), rgba(255, 244, 234, 0.88));
}

.share-card h3 {
  margin-top: 12px;
}

.share-card p:last-child {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.share-feedback {
  min-height: 26px;
  margin-top: 12px;
  color: var(--accent-deep);
  text-align: center;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media (min-width: 720px) {
  .page-shell {
    padding-top: 32px;
  }

  .page-shell.is-welcome {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .quiz-panel,
  .result-panel {
    min-height: 780px;
  }

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

  .full-span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .page-shell {
    width: min(calc(100vw - 20px), var(--max-width));
    padding-bottom: 28px;
  }

  .hero-panel,
  .quiz-panel,
  .result-panel {
    border-radius: 24px;
  }

  .hero-panel {
    padding-inline: 18px;
  }

  .question-card,
  .result-card {
    padding-inline: 16px;
  }

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