:root {
  --green: #33a474;
  --green-d: #279066;
  --purple: #88619a;
  --cyan: #4298b4;
  --gold: #e4ae3a;
  --navy: #2c2c3a;
  --text: #3d3d4f;
  --muted: #8b8b9c;
  --line: #e6e6ee;
  --bg: #f7f7fa;
  --hero: #eaf4f8;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(44, 44, 58, 0.08);
  --header-h: 72px;
  --serif: "Source Serif 4", "Songti SC", "Noto Serif SC", serif;
  --sans: "Nunito Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: #fff;
  min-height: 100vh;
  line-height: 1.6;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }

.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 100; }

.app-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid transparent;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}
.app-header.scrolled { border-bottom-color: var(--line); }

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -0.03em;
  color: var(--navy); font-size: 18px; white-space: nowrap;
}
.brand small {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
}
.logo-mark { flex: none; }

.nav-main {
  display: flex; gap: 4px; align-items: center;
}
.nav-main a {
  padding: 8px 14px; border-radius: 999px;
  color: #5c5c70; font-weight: 700; font-size: 15px;
}
.nav-main a:hover, .nav-main a.active { color: var(--navy); background: #f3f3f7; }

.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none; border: 0; background: transparent; width: 40px; height: 40px;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--navy); margin: 7px 8px; border-radius: 2px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; font-weight: 800; padding: 12px 22px;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 8px 18px rgba(51,164,116,.28); }
.btn-green:hover { background: var(--green-d); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-dark { background: var(--navy); color: #fff; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lg { padding: 16px 32px; font-size: 17px; }

.hero {
  background: var(--hero);
  text-align: center;
  padding: 56px 20px 0;
  overflow: hidden;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 4.2vw, 46px);
  color: var(--navy);
  line-height: 1.28;
  max-width: 820px;
  margin: 0 auto 16px;
}
.hero .lede {
  max-width: 620px; margin: 0 auto 8px;
  color: #4a4a5c; font-size: 18px;
}
.hero-art { margin: 12px auto -8px; width: min(1100px, 100%); height: auto; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; width: min(980px, calc(100% - 40px));
  margin: -42px auto 28px; position: relative; z-index: 2;
}
.stat {
  background: #fff; border-radius: 14px; padding: 22px 12px 18px;
  box-shadow: var(--shadow); text-align: center;
}
.stat:nth-child(1) { box-shadow: inset 0 4px 0 var(--cyan), var(--shadow); }
.stat:nth-child(2) { box-shadow: inset 0 4px 0 #f0e6c8, var(--shadow); }
.stat:nth-child(3) { box-shadow: inset 0 4px 0 #d8efe4, var(--shadow); }
.stat:nth-child(4) { box-shadow: inset 0 4px 0 #eadff0, var(--shadow); }
.stat b { display: block; font-size: 32px; color: var(--navy); letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; }

.section { padding: 72px 20px; }
.section-inner { width: min(1080px, 100%); margin: 0 auto; }
.section h2 {
  font-family: var(--serif); font-weight: 600; font-size: 34px;
  color: var(--navy); text-align: center; margin: 0 0 10px;
}
.section .sub {
  text-align: center; color: var(--muted); margin: 0 auto 36px; max-width: 640px;
}

.cta-band {
  text-align: center; padding: 28px 20px 64px; background: linear-gradient(#fff, var(--bg));
}

.groups { display: flex; flex-direction: column; gap: 40px; }
.group-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding-bottom: 12px; border-bottom: 3px solid currentColor; margin-bottom: 18px;
}
.group-head h3 { margin: 0; font-size: 22px; color: inherit; }
.group-head p { margin: 0; color: var(--text); font-size: 14px; max-width: 640px; }
.type-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.type-card {
  background: #fff; border-radius: var(--radius); padding: 18px 14px 16px;
  text-align: center; box-shadow: var(--shadow); border: 1px solid #f0f0f4;
  transition: transform .15s ease;
}
.type-card:hover { transform: translateY(-4px); }
.type-card .nick { font-weight: 800; color: var(--navy); margin-top: 4px; }
.type-card .code {
  font-size: 13px; font-weight: 800; letter-spacing: 0.12em; color: var(--muted);
}
.type-card .one { font-size: 13px; color: #5c5c70; margin: 8px 0 0; min-height: 3.6em; }
.type-card .avatar { margin: 0 auto; }

.footer {
  background: #1b1b24; color: #c8c8d4; padding: 48px 20px 28px;
}
.footer-inner {
  width: min(1080px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px;
}
.footer h4 { color: #fff; margin: 0 0 12px; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.footer a { display: block; padding: 4px 0; color: #bdbdca; font-size: 14px; }
.footer a:hover { color: #fff; }
.footer .legal {
  width: min(1080px, 100%); margin: 28px auto 0; padding-top: 18px;
  border-top: 1px solid #2e2e3a; font-size: 12px; color: #8e8e9c;
}

.page-hero {
  background: var(--bg); text-align: center; padding: 48px 20px 32px;
}
.page-hero h1 {
  font-family: var(--serif); font-size: clamp(32px, 4vw, 48px);
  margin: 12px 0 8px; color: var(--navy); font-weight: 600;
}
.page-hero p { color: #5c5c70; margin: 0 auto; max-width: 560px; }

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  width: min(980px, calc(100% - 40px)); margin: 0 auto 8px;
}
.step-card {
  background: #fff; border-radius: 18px; padding: 22px; text-align: left;
  box-shadow: var(--shadow); min-height: 180px; position: relative; overflow: hidden;
}
.step-card .badge {
  display: inline-block; background: #eef2f4; color: #667; font-size: 12px;
  font-weight: 800; border-radius: 999px; padding: 4px 10px; margin-bottom: 10px;
}
.step-card h3 { margin: 0 0 6px; color: var(--navy); }
.step-card p { margin: 0; color: #66677a; font-size: 14px; }
.step-illust {
  position: absolute; right: 8px; bottom: -6px; width: 110px; height: 90px; opacity: .95;
}

.quiz-wrap { background: #111118; color: #fff; padding: 28px 16px 80px; min-height: calc(100vh - var(--header-h)); }
.quiz-inner { width: min(760px, 100%); margin: 0 auto; }
.progress-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px; color: #bdbdca; font-size: 13px; font-weight: 700;
}
.progress-bar { flex: 1; height: 6px; background: #2a2a36; border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--green); width: 0; transition: width .25s ease; }
.section-label { color: #9a9aaa; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.section-title { font-family: var(--serif); font-size: 28px; margin: 0 0 6px; }
.section-hint { color: #a0a0b0; margin: 0 0 28px; }

.q-block { padding: 28px 0; border-top: 1px solid #2a2a36; }
.q-text { font-size: 20px; font-weight: 700; line-height: 1.45; margin: 0 0 18px; }
.likert {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.likert-side {
  font-weight: 800; font-size: 13px; min-width: 64px;
}
.likert-side.agree { color: var(--green); text-align: left; }
.likert-side.disagree { color: var(--purple); text-align: right; }
.likert-dots { display: flex; align-items: center; justify-content: center; gap: 10px; flex: 1; }
.dot {
  appearance: none; border: 3px solid currentColor; border-radius: 50%;
  background: transparent; padding: 0; display: grid; place-items: center;
  color: #666; transition: transform .12s ease, background .12s ease, color .12s ease;
}
.dot:hover { transform: scale(1.06); }
.dot::after {
  content: ""; width: 42%; height: 42%; border-radius: 50%; background: currentColor; opacity: .0;
}
.dot[aria-checked="true"]::after { opacity: 1; }
.dot.s5 { width: 54px; height: 54px; color: var(--green); }
.dot.s4 { width: 42px; height: 42px; color: #4db888; }
.dot.s3 { width: 30px; height: 30px; color: #8d8d9c; }
.dot.s2 { width: 42px; height: 42px; color: #a07ab3; }
.dot.s1 { width: 54px; height: 54px; color: var(--purple); }
.dot[aria-checked="true"].s5, .dot[aria-checked="true"].s4 { background: rgba(51,164,116,.12); }
.dot[aria-checked="true"].s1, .dot[aria-checked="true"].s2 { background: rgba(136,97,154,.12); }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start;
  background: #1b1b26; border: 2px solid #323242; color: #fff;
  border-radius: 14px; padding: 14px 16px; text-align: left; font-size: 16px; font-weight: 650;
}
.choice:hover { border-color: #4a4a60; }
.choice[aria-checked="true"] { border-color: var(--green); background: #16241e; }
.choice .key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; background: #2a2a38;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #cfcfe0;
}
.choice[aria-checked="true"] .key { background: var(--green); color: #fff; }

.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

.consent {
  background: #fff; color: var(--text); border-radius: 18px; padding: 28px;
  width: min(720px, calc(100% - 40px)); margin: 28px auto 48px; box-shadow: var(--shadow);
}
.consent h2 { font-family: var(--serif); margin: 0 0 12px; color: var(--navy); }
.consent ul { padding-left: 18px; color: #555566; }
.field { margin: 14px 0; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: #555; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px;
  background: #fff; color: var(--navy);
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; }

.result-top {
  padding: 48px 20px 24px; text-align: center; color: #fff;
}
.result-top .kicker { font-weight: 800; letter-spacing: .14em; font-size: 12px; opacity: .85; }
.result-top h1 { font-family: var(--serif); font-size: clamp(36px, 5vw, 56px); margin: 8px 0 4px; }
.result-top .official { opacity: .9; margin: 0; }
.result-layout {
  width: min(1080px, calc(100% - 40px)); margin: 0 auto;
  display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start;
  padding-bottom: 24px;
}
.result-avatar { text-align: center; }
.result-avatar .code-xl {
  font-size: 28px; font-weight: 800; letter-spacing: .18em; margin-top: 8px;
}
.panel {
  background: #fff; color: var(--text); border-radius: 18px; padding: 28px;
  box-shadow: var(--shadow); margin: 0 20px 24px;
}
.panel-wide { width: min(1080px, calc(100% - 40px)); margin: 0 auto 24px; }
.panel h2 { font-family: var(--serif); color: var(--navy); margin: 0 0 12px; font-size: 26px; }
.one-liner { font-size: 18px; color: var(--navy); }
.note {
  background: #f6f6fa; border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #555566;
}

.trait { margin: 22px 0 28px; }
.trait-top {
  display: grid; grid-template-columns: 64px 1fr 64px; gap: 12px; align-items: center;
  font-size: 13px; font-weight: 800; color: #666; margin-bottom: 8px;
}
.trait-top span:first-child { text-align: left; color: var(--navy); }
.trait-top span:last-child { text-align: right; color: var(--navy); }
.trait-name { text-align: center; font-size: 12px; letter-spacing: .04em; color: var(--muted); font-weight: 800; }
.bar {
  height: 12px; background: #ececf2; border-radius: 99px; overflow: hidden; display: flex;
}
.bar i { display: block; height: 100%; }
.trait-labels {
  display: flex; justify-content: space-between; margin-top: 8px; font-weight: 800; color: var(--navy);
}
.trait p { margin: 10px 0 0; color: #555566; }
.balanced-tag {
  display: inline-block; margin-left: 8px; font-size: 11px; background: #eef2f4;
  color: #667; border-radius: 99px; padding: 2px 8px; vertical-align: middle;
}

.portrait-list { display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 0; list-style: none; }
.portrait-list li {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start;
}
.portrait-list b {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 13px;
}

.subject-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.subject-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.subject-item strong { display: block; color: var(--navy); margin-bottom: 4px; }

.fit-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fit-row button {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 8px 14px; font-weight: 800; color: var(--navy);
}
.fit-row button[aria-checked="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dim-card {
  background: #fff; border-radius: 16px; padding: 22px; box-shadow: var(--shadow); border-top: 4px solid var(--cyan);
}
.dim-card h3 { margin: 0 0 6px; color: var(--navy); }
.dim-card .ask { color: var(--muted); font-weight: 700; font-size: 13px; margin-bottom: 10px; }

.warn {
  font-size: 13px; color: #6a6a7a; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px;
}

@media (max-width: 900px) {
  .stats, .type-grid, .steps, .footer-inner, .result-layout, .dim-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-toggle { display: block; }
  .nav-main {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 12px; border-bottom: 1px solid var(--line);
  }
  .nav-main.open { display: flex; }
  .hero h1 { font-size: 28px; }
  .likert { flex-direction: column; }
  .likert-dots { width: 100%; }
  .q-text { font-size: 18px; }
}

@media (max-width: 640px) {
  .stats, .type-grid, .steps, .footer-inner, .result-layout, .dim-grid { grid-template-columns: 1fr; }
  .app-header { padding: 0 12px; }
  .dot.s5, .dot.s1 { width: 44px; height: 44px; }
  .dot.s4, .dot.s2 { width: 36px; height: 36px; }
  .hero { padding-top: 32px; }
}

@media print {
  .app-header, .footer, .quiz-nav, .btn, .nav-toggle { display: none !important; }
  .panel, .result-top { box-shadow: none; }
}
