:root {
  color-scheme: light;
  --ink: #171817;
  --muted: #626761;
  --paper: #ffffff;
  --ground: #f2f4f0;
  --line: #d7dbd4;
  --soft-line: #e8ebe6;
  --as: #1f7a65;
  --ai: #df5a3f;
  --es: #3f65b5;
  --ei: #b98612;
  --green-bg: #edf7f2;
  --red-bg: #fff1ee;
  --focus: #171817;
  --radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--ground);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 24, 23, 0.2);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark__jas {
  font-size: 22px;
  font-weight: 850;
}

.brand-mark__name {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  font-size: 22px;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 980px);
  min-height: calc(100vh - 128px);
  margin: 0 auto;
  padding: 54px 28px 80px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 22px 28px 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.loading-state {
  display: grid;
  gap: 14px;
  width: min(100%, 520px);
  padding-top: 80px;
}

.loading-line {
  height: 20px;
  background: #e1e4df;
  animation: pulse 1.2s ease-in-out infinite alternate;
}

.loading-line--short {
  width: 62%;
}

@keyframes pulse {
  to {
    opacity: 0.45;
  }
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: 42px;
  line-height: 1.14;
  font-weight: 820;
}

h2 {
  margin-bottom: 14px;
  font-size: 26px;
  line-height: 1.25;
}

h3 {
  font-size: 18px;
  line-height: 1.35;
}

.lede {
  max-width: 680px;
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.form-stack {
  display: grid;
  gap: 26px;
  width: min(100%, 720px);
}

.field-group {
  display: grid;
  gap: 10px;
}

.field-label,
.legend-label {
  font-size: 14px;
  font-weight: 760;
}

.text-input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  padding: 11px 13px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.segment-option {
  position: relative;
  display: block;
}

.segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-option span {
  display: flex;
  min-height: 62px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.segment-option input:checked + span {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 720px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.privacy-note__mark {
  flex: 0 0 auto;
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 46px;
  border-radius: var(--radius);
  padding: 10px 17px;
  font-weight: 760;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--ink);
  color: #ffffff;
  background: var(--ink);
}

.primary-button:hover {
  background: #30322f;
}

.primary-button:disabled {
  border-color: #b8bdb6;
  background: #b8bdb6;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}

.text-button {
  border: 0;
  color: var(--ink);
  background: transparent;
  padding-inline: 4px;
}

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

.local-history-entry {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.local-history-entry div {
  display: grid;
  gap: 4px;
}

.local-history-entry span,
.local-save-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.local-save-status {
  margin: 14px 0 0;
}

.inline-button {
  border: 0;
  color: var(--ink);
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 750;
  text-decoration: underline;
  cursor: pointer;
}

.history-list {
  display: grid;
  gap: 12px;
  margin: 30px 0;
}

.history-item {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 20px;
}

.history-item span,
.history-item p {
  color: var(--muted);
  font-size: 13px;
}

.history-item h2 {
  margin: 5px 0;
  font-size: 20px;
}

.history-item p {
  margin: 0;
}

.history-item__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.empty-state {
  border: 1px dashed var(--line);
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.question-shell {
  width: min(100%, 820px);
  margin: 0 auto;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 44px;
}

.progress-track {
  flex: 1;
  height: 6px;
  overflow: hidden;
  background: #dfe3dd;
}

.progress-fill {
  height: 100%;
  background: var(--ink);
  transition: width 180ms ease;
}

.progress-count {
  min-width: 66px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.question-title {
  min-height: 74px;
  margin-bottom: 26px;
  font-size: 27px;
  line-height: 1.38;
}

.choice-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.choice-card {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 20px;
}

.choice-card__label {
  display: grid;
  width: 28px;
  height: 28px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.choice-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 32px;
}

.scale-direction {
  display: flex;
  justify-content: space-between;
  margin: 0 2px 8px;
  color: var(--muted);
  font-size: 11px;
}

.scale-choice {
  position: relative;
}

.scale-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scale-choice span {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
}

.scale-choice input:checked + span {
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  font-weight: 760;
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

.result-page {
  --accent: var(--ei);
}

.result-page[data-family="确定守护"] {
  --accent: var(--as);
}

.result-page[data-family="方案启发"] {
  --accent: var(--ai);
}

.result-page[data-family="身份秩序"] {
  --accent: var(--es);
}

.result-page[data-family="世界启发"] {
  --accent: var(--ei);
}

.result-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
  padding: 18px 0 54px;
}

.type-figure {
  display: block;
  position: relative;
  width: 220px;
  height: auto;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--accent);
}

.type-code {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 850;
}

.result-name {
  margin-bottom: 6px;
  font-size: 43px;
}

.result-english {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.visual-atlas {
  padding-bottom: 70px;
}

.visual-atlas__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.visual-atlas__card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.visual-atlas__card canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 350 / 430;
}

.visual-atlas__card div {
  display: grid;
  gap: 3px;
  padding: 14px 15px 16px;
}

.visual-atlas__card strong {
  font-size: 14px;
}

.visual-atlas__card span {
  color: var(--muted);
  font-size: 12px;
}

.result-definition {
  max-width: 650px;
  margin-bottom: 24px;
  font-size: 19px;
  line-height: 1.7;
}

.result-section {
  padding: 42px 0;
  border-top: 1px solid var(--line);
}

.section-intro {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.7;
}

.axis-list {
  display: grid;
  gap: 26px;
  margin-top: 28px;
}

.axis-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: center;
}

.axis-label {
  font-size: 14px;
  font-weight: 730;
}

.axis-label--right {
  text-align: right;
}

.axis-bar {
  position: relative;
  height: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e5e8e3;
}

.axis-bar__left,
.axis-bar__right {
  position: absolute;
  top: 0;
  bottom: 0;
}

.axis-bar__left {
  left: 0;
  background: var(--accent);
}

.axis-bar__right {
  right: 0;
  background: #cfd4cd;
}

.axis-detail {
  grid-column: 2;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

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

.trait-item {
  min-height: 76px;
  border-left: 4px solid var(--accent);
  background: var(--paper);
  padding: 14px 16px;
  line-height: 1.55;
}

.blind-spot {
  max-width: 760px;
  margin: 28px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--soft-line);
  font-size: 16px;
  line-height: 1.7;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.action-column {
  padding: 22px;
  border-radius: var(--radius);
}

.action-column--green {
  background: var(--green-bg);
}

.action-column--red {
  background: var(--red-bg);
}

.action-column h3 {
  margin-bottom: 15px;
}

.action-column ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
  line-height: 1.6;
}

.reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.reference-tag {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  padding: 9px 11px;
  font-size: 14px;
}

.paid-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 30px 0;
}

.paid-strip p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.paid-strip__actions {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.research-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 24, 23, 0.5);
}

.dialog {
  width: min(100%, 460px);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 28px;
  box-shadow: 0 20px 60px rgba(23, 24, 23, 0.22);
}

.dialog p {
  color: var(--muted);
  line-height: 1.65;
}

.form-dialog {
  width: min(100%, 680px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.dialog-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.dialog-heading .eyebrow {
  margin-bottom: 5px;
}

.dialog-heading h2 {
  margin: 0;
}

.dialog-close {
  flex: 0 0 auto;
}

.purchase-steps {
  display: grid;
  gap: 9px;
  margin: 24px 0;
  padding-left: 24px;
  line-height: 1.55;
}

.form-dialog .form-stack {
  gap: 18px;
}

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

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.consent-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

.form-status {
  min-height: 22px;
  margin: 0;
  font-size: 13px;
}

.share-dialog {
  width: min(100%, 620px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.share-dialog__heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.share-dialog__heading .eyebrow {
  margin-bottom: 5px;
}

.share-dialog__heading h2 {
  margin: 0;
}

.share-dialog__close {
  min-height: 40px;
  flex: 0 0 auto;
}

.share-card-preview {
  display: block;
  width: min(100%, 360px);
  aspect-ratio: 3 / 4;
  margin: 22px auto;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #f2f4f0;
}

.share-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.share-dialog__hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 34px 18px 64px;
  }

  .site-footer {
    flex-direction: column;
    padding-inline: 18px;
  }

  h1 {
    font-size: 34px;
  }

  .question-title {
    min-height: 0;
    font-size: 23px;
  }

  .progress-row {
    margin-bottom: 34px;
  }

  .choice-pair,
  .action-grid,
  .trait-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 118px;
  }

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

  .result-hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .type-figure {
    width: 190px;
  }

  .visual-atlas__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .result-name {
    font-size: 36px;
  }

  .axis-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }

  .axis-label--right {
    grid-column: 2;
    grid-row: 1;
  }

  .axis-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .axis-detail {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .paid-strip {
    grid-template-columns: 1fr;
  }

  .research-callout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .brand-mark__name {
    display: none;
  }

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

  .choice-card p {
    font-size: 15px;
  }

  .scale-choice span {
    min-height: 58px;
  }

  .dialog {
    padding: 20px;
  }

  .local-history-entry,
  .history-item {
    align-items: stretch;
    flex-direction: column;
  }

  .history-item__actions > * {
    flex: 1 1 auto;
  }

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

  .share-dialog__actions > * {
    flex: 1 1 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
