:root {
  color-scheme: light;
  --bg: #f7f9f5;
  --surface: #ffffff;
  --surface-soft: #eef4ee;
  --ink: #1e2a27;
  --muted: #62706a;
  --line: #d9e1da;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #d8efeb;
  --accent: #d97706;
  --coral: #c2410c;
  --rose: #be123c;
  --shadow: 0 18px 48px rgba(36, 48, 43, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06), transparent 38%),
    linear-gradient(180deg, #fbfcf8 0%, #eef4ef 100%);
  background-attachment: fixed;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  background: transparent;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 2rem;
  font-weight: 760;
}

.brand p {
  max-width: 700px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.status-strip {
  min-width: 224px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(36, 48, 43, 0.08);
}

.status-number {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-weight: 740;
}

.status-number strong {
  font-size: 1.45rem;
}

.progress-track {
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dde7de;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #84a11f);
  transition: width 180ms ease;
}

.survey-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(252px, 300px);
  gap: 18px;
  align-items: start;
}

.question-panel,
.result-panel,
.side-panel,
.notice-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.question-panel {
  min-height: min(620px, calc(100vh - 156px));
  padding: clamp(20px, 4vw, 36px);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbf7;
  color: var(--muted);
  white-space: nowrap;
}

.question-text {
  min-height: 128px;
  margin: 24px 0 28px;
  font-size: 1.85rem;
  line-height: 1.5;
  font-weight: 700;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.scale-button {
  min-height: 120px;
  padding: 14px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.scale-button strong,
.scale-button span {
  display: block;
}

.scale-button strong {
  font-size: 1.45rem;
}

.scale-button span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.scale-button:hover,
.scale-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  outline: none;
  transform: translateY(-1px);
}

.scale-button.is-selected {
  border-color: var(--primary-dark);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
}

.scale-button.is-selected span {
  color: rgba(255, 255, 255, 0.88);
}

.question-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--primary);
  outline: none;
  transform: translateY(-1px);
}

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

.btn.subtle {
  background: var(--surface-soft);
}

.btn.warning {
  border-color: #f0c282;
  color: #7c3f00;
  background: #fff7e8;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

.landing-page {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: -28px;
}

.landing-hero {
  display: grid;
  min-height: min(720px, calc(100svh - 96px));
  align-items: center;
  padding: 86px max(24px, calc((100vw - 1180px) / 2)) 72px;
  background:
    linear-gradient(90deg, rgba(247, 249, 245, 0.96) 0%, rgba(247, 249, 245, 0.84) 34%, rgba(247, 249, 245, 0.2) 70%),
    url("/assets/landing-hero.png") center / cover no-repeat;
}

.landing-copy {
  width: min(620px, 100%);
}

.landing-kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-copy h1 {
  margin: 0;
  font-size: 3.2rem;
  line-height: 1.12;
  font-weight: 800;
}

.landing-copy p {
  margin: 18px 0 0;
  color: #41504a;
  font-size: 1.12rem;
  line-height: 1.8;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 30px;
}

.landing-start {
  min-height: 48px;
  padding-inline: 22px;
  font-weight: 740;
}

.landing-note {
  color: var(--muted);
  line-height: 1.55;
}

.landing-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(1180px, calc(100% - 32px));
  margin: -34px auto 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.landing-summary div {
  min-height: 138px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
}

.landing-summary strong,
.landing-summary span {
  display: block;
}

.landing-summary strong {
  margin-bottom: 9px;
  font-size: 1rem;
}

.landing-summary span {
  color: var(--muted);
  line-height: 1.65;
}

.side-panel {
  position: sticky;
  top: 18px;
  padding: 16px;
}

.side-panel h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.question-map {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.map-dot {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid #cbd8cf;
  background: #f8fbf7;
  color: transparent;
  cursor: pointer;
}

.map-dot.is-answered {
  border-color: #7aa53b;
  background: #d9ebc2;
}

.map-dot.is-current {
  border-color: var(--primary-dark);
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.legend-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fbf7;
}

.legend-swatch.answered {
  border-color: #7aa53b;
  background: #d9ebc2;
}

.legend-swatch.current {
  border-color: var(--primary);
  background: var(--primary);
}

.result-panel {
  padding: clamp(20px, 3vw, 30px);
}

.report-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.report-title h1 {
  margin: 8px 0 10px;
  font-size: 2.15rem;
}

.report-title p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.label-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff2df;
  color: #7c3f00;
  font-weight: 700;
}

.chart-shell {
  width: min(360px, 100%);
}

.report-visual-stack {
  display: grid;
  width: min(380px, 100%);
  gap: 14px;
}

.character-panel {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--role-accent) 30%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--role-soft), #ffffff 58%);
}

.character-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 14px 14px 0;
}

.character-head span {
  color: var(--muted);
  font-size: 0.86rem;
}

.character-head strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.character-stage {
  position: relative;
  aspect-ratio: 700 / 760;
  margin: 10px 14px 0;
  overflow: hidden;
  border-radius: 6px;
}

.character-sprite {
  position: absolute;
  inset: 0 auto 0 0;
  width: 200%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.character-sprite.variant-1 {
  transform: translateX(0);
}

.character-sprite.variant-2 {
  transform: translateX(-50%);
}

.role-toggle {
  display: grid;
  padding: 10px;
}

.role-toggle button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  cursor: pointer;
}

.role-toggle button:hover,
.role-toggle button:focus-visible {
  border-color: var(--role-accent);
  background: var(--role-accent);
  color: #ffffff;
  outline: none;
}

.radar-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.score-section,
.share-box,
.detail-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
}

.score-section,
.detail-section {
  padding: 16px;
}

.score-section h2,
.detail-section h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.insight-group {
  margin-bottom: 16px;
}

.insight-group h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.score-list {
  display: grid;
  gap: 11px;
}

.score-row {
  display: grid;
  gap: 7px;
}

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

.score-name {
  font-weight: 720;
}

.score-value {
  color: var(--muted);
  white-space: nowrap;
}

.bar-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e9e2;
}

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

.score-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.share-box {
  padding: 14px;
}

.share-title {
  margin: 0 0 10px;
  font-weight: 720;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.share-row.secondary {
  grid-template-columns: 1fr;
  margin-top: 9px;
}

.qr-preview {
  display: grid;
  width: 132px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.qr-svg {
  width: 100%;
  height: auto;
}

.qr-fallback {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.share-row input {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
}

.share-message,
.empty-message {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.share-message.error {
  color: var(--rose);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sub-score {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.sub-score strong,
.sub-score span {
  display: block;
}

.sub-score strong {
  margin-bottom: 6px;
}

.sub-score span {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.insight-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.insight-list li:last-child {
  border-bottom: 0;
}

.notice-panel {
  padding: 20px;
  color: var(--muted);
  line-height: 1.7;
}

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

.loading strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .app {
    width: min(100% - 28px, 1180px);
  }

  .survey-layout {
    grid-template-columns: minmax(0, 1fr) 252px;
  }

  .scale-grid {
    gap: 8px;
  }

  .scale-button {
    min-height: 108px;
    padding-inline: 6px;
  }

  .scale-button strong {
    font-size: 1.35rem;
  }

  .scale-button span {
    font-size: 0.92rem;
  }
}

@media (max-width: 980px) {
  .topbar,
  .survey-layout,
  .report-header,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .status-strip,
  .chart-shell,
  .report-visual-stack {
    width: 100%;
  }

  .report-visual-stack {
    grid-template-columns: minmax(280px, 0.8fr) minmax(260px, 1fr);
    align-items: center;
  }

  .side-panel {
    position: static;
  }

  .question-map {
    grid-template-columns: repeat(14, 1fr);
  }

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

  .scale-button {
    min-height: 92px;
  }

  .landing-hero {
    min-height: min(680px, calc(100svh - 82px));
    padding: 72px 24px 86px;
    background:
      linear-gradient(90deg, rgba(247, 249, 245, 0.97) 0%, rgba(247, 249, 245, 0.78) 58%, rgba(247, 249, 245, 0.28) 100%),
      url("/assets/landing-hero.png") center / cover no-repeat;
  }

  .landing-summary {
    grid-template-columns: 1fr;
    margin-top: -42px;
  }

  .landing-summary div {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .brand h1 {
    font-size: 1.55rem;
  }

  .report-title h1 {
    font-size: 1.65rem;
  }

  .question-text {
    min-height: auto;
    font-size: 1.35rem;
  }

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

  .scale-button:nth-child(7) {
    grid-column: 1 / -1;
  }

  .landing-copy h1 {
    font-size: 2.15rem;
  }

  .landing-copy p {
    font-size: 1rem;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .question-panel {
    min-height: auto;
  }

  .question-text {
    min-height: auto;
  }

  .question-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .button-group,
  .btn {
    width: 100%;
  }

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

  .question-map {
    grid-template-columns: repeat(10, 1fr);
  }

  .landing-page {
    margin-top: -16px;
  }

  .landing-hero {
    min-height: min(640px, calc(100svh - 76px));
    padding: 54px 18px 82px;
    background:
      linear-gradient(180deg, rgba(247, 249, 245, 0.98) 0%, rgba(247, 249, 245, 0.84) 56%, rgba(247, 249, 245, 0.42) 100%),
      url("/assets/landing-hero.png") 63% center / cover no-repeat;
  }

  .landing-actions,
  .landing-actions .btn {
    width: 100%;
  }

  .landing-note {
    width: 100%;
  }

  .landing-summary {
    width: min(100% - 20px, 1180px);
    margin-bottom: 28px;
  }

  .report-visual-stack {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 420px) {
  .brand p {
    font-size: 0.95rem;
  }

  .question-panel,
  .result-panel,
  .side-panel,
  .notice-panel {
    border-radius: 6px;
  }

  .scale-button {
    min-height: 78px;
    padding-block: 10px;
  }

  .scale-button strong {
    font-size: 1.25rem;
  }

  .scale-button span {
    margin-top: 5px;
    font-size: 0.86rem;
  }

  .question-map {
    grid-template-columns: repeat(7, 1fr);
  }

  .landing-copy h1 {
    font-size: 1.78rem;
  }

  .landing-summary div {
    padding: 16px;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .question-panel {
    min-height: auto;
  }

  .question-text {
    min-height: 82px;
    margin: 18px 0 20px;
    font-size: 1.45rem;
  }

  .scale-button {
    min-height: 88px;
  }
}
