:root {
  --bg: #f6f1e8;
  --bg-strong: #e4d4bc;
  --card: rgba(255, 252, 247, 0.9);
  --card-strong: #fffaf2;
  --ink: #1f1d1a;
  --muted: #6a655d;
  --line: rgba(64, 50, 28, 0.12);
  --accent: #b24a2c;
  --accent-dark: #8d351d;
  --accent-soft: rgba(178, 74, 44, 0.12);
  --shadow: 0 24px 60px rgba(80, 48, 18, 0.12);
  --radius-xl: 28px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Outfit', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 162, 99, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(178, 74, 44, 0.22), transparent 24%),
    linear-gradient(180deg, #f7efe3 0%, #f2ece4 36%, #f9f5ef 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 90%);
}

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

.page-shell--stats {
  width: min(980px, calc(100% - 32px));
}

.hero {
  padding: 36px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.9), rgba(241, 228, 208, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.eyebrow,
.section-kicker,
.stat-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.08;
}

.intro {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
  white-space: pre-line;
}

.survey-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.question-section + .question-section {
  margin-top: 36px;
}

.section-header {
  margin-bottom: 18px;
}

.section-header h2,
.stats-card h3 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.question-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-strong);
}

.question-card + .question-card {
  margin-top: 16px;
}

.question-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
}

.question-number {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.question-head h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
}

.question-prompt {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.question-body {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.choice:hover {
  transform: translateY(-1px);
  border-color: rgba(178, 74, 44, 0.35);
  box-shadow: 0 10px 24px rgba(178, 74, 44, 0.08);
}

.choice input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.matrix-wrap {
  overflow-x: auto;
}

.matrix-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.matrix-table th,
.matrix-table td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  text-align: left;
}

.matrix-table thead th {
  background: rgba(178, 74, 44, 0.08);
}

.matrix-radio {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.matrix-radio input {
  accent-color: var(--accent);
}

.submit-row {
  position: sticky;
  bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 249, 240, 0.95);
  backdrop-filter: blur(8px);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(178, 74, 44, 0.22);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.form-status {
  margin: 0;
  color: #296347;
  font-weight: 600;
}

.form-status--error {
  color: #9d2f2f;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat,
.stats-card,
.stats-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.stats-card + .stats-card {
  margin-top: 18px;
}

.bar-row + .bar-row,
.stats-item + .stats-item {
  margin-top: 14px;
}

.bar-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 0.96rem;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(178, 74, 44, 0.1);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d98e58, var(--accent));
}

.stats-average {
  margin: 8px 0 12px;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding: 20px 0 36px;
  }

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

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

  .question-number {
    width: 42px;
    height: 42px;
  }

  .submit-row,
  .stats-summary,
  .bar-copy {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  button {
    width: 100%;
  }
}
