:root {
  color-scheme: dark;
  --ink: #f5edf0;
  --muted: #b8aeb3;
  --muted-2: #887d83;
  --night: #0f0c0e;
  --night-soft: #191216;
  --panel: rgba(29, 20, 25, 0.86);
  --panel-solid: #21171c;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --shadow: #d7e0ef;
  --shadow-soft: #8ea0b8;
  --light: #ef627e;
  --light-soft: #ff9caf;
  --success: #91d0ad;
  --danger: #ff8c9f;
  --radius: 26px;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(142, 53, 77, 0.26), transparent 38rem),
    linear-gradient(180deg, #110c0f 0%, #0e0c0d 55%, #120c10 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 42rem;
  height: 42rem;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-left {
  top: 12vh;
  left: -35rem;
  background: #7d9dc7;
}

.ambient-right {
  top: 35vh;
  right: -35rem;
  background: #d83d65;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(44px, env(safe-area-inset-bottom));
}

.screen {
  display: none;
  animation: reveal 0.5s ease both;
}

.screen.active {
  display: block;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand-line {
  display: flex;
  justify-content: space-between;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.19em;
}

.landing-screen {
  padding-bottom: 26px;
}

.seal {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  margin: 52px auto 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(125deg, rgba(189, 208, 234, 0.13), rgba(239, 98, 126, 0.13));
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.015),
    0 24px 75px rgba(0, 0, 0, 0.35);
  font-family: Georgia, serif;
  font-size: 28px;
  letter-spacing: 0.04em;
}

.seal::before,
.seal::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
}

.seal::after {
  inset: 18px;
}

.seal-shadow {
  color: var(--shadow);
}

.seal-light {
  color: var(--light-soft);
}

.seal-divider {
  width: 1px;
  height: 34px;
  margin: 0 13px;
  background: var(--line-strong);
  transform: rotate(18deg);
}

.hero-copy {
  text-align: center;
}

.eyebrow,
.result-eyebrow {
  margin: 0 0 12px;
  color: var(--light-soft);
  font-size: 12px;
  letter-spacing: 0.28em;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 9vw, 62px);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.16;
}

.hero-copy h1 i {
  margin: 0 0.12em;
  color: var(--muted-2);
  font-family: Georgia, serif;
  font-weight: 400;
}

.hero-subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.07em;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 38px 0 18px;
}

.feature-row div {
  min-width: 0;
  padding: 18px 6px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.feature-row strong,
.feature-row span {
  display: block;
}

.feature-row strong {
  margin-bottom: 6px;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 500;
}

.feature-row span {
  color: var(--muted-2);
  font-size: 11px;
}

.access-card,
.question-card,
.result-card,
.radar-card,
.narrative-card,
.dimension-card,
.tension-card,
.detail-card,
.action-card,
.disclaimer-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(18px);
}

.access-card {
  padding: 23px;
}

.notice {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.notice span {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.notice p,
.landing-foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.notice p {
  margin: 9px 0 0;
}

.consent {
  display: grid;
  grid-template-columns: 19px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  cursor: pointer;
}

.consent input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--light);
}

.input-label {
  display: block;
  margin: 24px 0 9px;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.code-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.code-field:focus-within {
  border-color: rgba(239, 98, 126, 0.6);
  box-shadow: 0 0 0 3px rgba(239, 98, 126, 0.1);
}

.code-field input {
  width: 100%;
  min-width: 0;
  padding: 15px 14px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.code-field input::placeholder {
  color: #6f656a;
}

.code-field span {
  padding: 0 14px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.message {
  min-height: 20px;
  margin: 9px 0 8px;
  color: var(--danger);
  font-size: 12px;
}

.message.ok {
  color: var(--success);
}

.button {
  min-height: 51px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, border-color 0.16s ease;
}

.button:not(:disabled):active {
  transform: scale(0.985);
}

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

.primary-button {
  width: 100%;
  color: white;
  background: linear-gradient(120deg, #bc3554, #ef627e 58%, #dd4465);
  box-shadow: 0 13px 38px rgba(206, 57, 91, 0.2);
  font-weight: 650;
  letter-spacing: 0.04em;
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.text-button {
  color: var(--muted-2);
  background: transparent;
}

.landing-foot {
  margin: 18px 0 0;
  text-align: center;
}

.quiz-screen {
  padding-top: 12px;
}

.quiz-header {
  position: sticky;
  z-index: 5;
  top: 0;
  padding: 10px 0 20px;
  background: linear-gradient(180deg, #100d0f 68%, transparent);
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.quiz-meta strong {
  color: var(--light-soft);
  font-weight: 500;
}

.progress-track {
  height: 3px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-track i {
  display: block;
  width: 2%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--shadow-soft), var(--light));
  transition: width 0.3s ease;
}

.question-card {
  min-height: 520px;
  padding: 28px 22px 22px;
}

.question-number {
  color: var(--light-soft);
  font-family: Georgia, serif;
  font-size: 37px;
}

.question-hint {
  margin: 8px 0 28px;
  color: var(--muted-2);
  font-size: 11px;
}

.question-card h2 {
  min-height: 94px;
  margin: 0 0 28px;
  font-family: var(--serif);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 550;
  line-height: 1.55;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.option:hover {
  border-color: rgba(239, 98, 126, 0.32);
}

.option b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted-2);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 500;
}

.option.selected {
  border-color: rgba(239, 98, 126, 0.65);
  color: var(--ink);
  background: linear-gradient(100deg, rgba(239, 98, 126, 0.14), rgba(255, 255, 255, 0.035));
  box-shadow: inset 3px 0 0 var(--light);
}

.option.selected b {
  border-color: var(--light);
  color: white;
  background: var(--light);
}

.quiz-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
  margin-top: 14px;
}

.result-screen {
  padding-top: 12px;
}

.result-dossier {
  position: relative;
  overflow: hidden;
  padding: 38px 20px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 15%, rgba(156, 184, 220, 0.13), transparent 32%),
    radial-gradient(circle at 82% 20%, rgba(239, 98, 126, 0.16), transparent 34%),
    var(--panel-solid);
  text-align: center;
}

.result-dossier::before {
  content: "XIV";
  position: absolute;
  top: -38px;
  right: -5px;
  color: rgba(255, 255, 255, 0.025);
  font-family: Georgia, serif;
  font-size: 190px;
  line-height: 1;
}

.result-dossier h2 {
  position: relative;
  margin: 8px 0 10px;
  font-family: var(--serif);
  font-size: clamp(34px, 9vw, 58px);
  font-weight: 560;
  letter-spacing: 0.06em;
}

.archetype-subtitle {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.dual-cards {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 30px;
}

.polarity-card {
  min-width: 0;
  padding: 19px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.16);
}

.polarity-card small,
.polarity-card strong,
.polarity-card b {
  display: block;
}

.polarity-card small {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.polarity-card strong {
  margin: 9px 0 7px;
  font-family: var(--serif);
  font-size: 25px;
}

.polarity-card b {
  font-family: Georgia, serif;
  font-size: 31px;
  font-weight: 500;
}

.polarity-card.shadow b,
.polarity-card.shadow strong {
  color: var(--shadow);
}

.polarity-card.light b,
.polarity-card.light strong {
  color: var(--light-soft);
}

.balance-summary {
  position: relative;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.balance-summary b {
  color: var(--ink);
}

.section-stack {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.radar-card,
.narrative-card,
.dimension-card,
.tension-card,
.detail-card,
.action-card,
.disclaimer-card {
  padding: 22px;
}

.card-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-heading h3,
.narrative-card h3,
.detail-card h3,
.action-card h3,
.disclaimer-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 560;
}

.card-heading span {
  color: var(--muted-2);
  font-size: 10px;
}

.twin-radar {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.radar-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}

.legend-shadow {
  background: var(--shadow-soft);
}

.legend-light {
  background: var(--light);
}

.narrative-card p,
.detail-card p,
.disclaimer-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.portrait-lead {
  color: var(--ink) !important;
  font-size: 15px !important;
}

.dimension-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.dimension-group h4 {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.dimension-row {
  display: grid;
  grid-template-columns: 46px 1fr 34px;
  gap: 9px;
  align-items: center;
  margin: 11px 0;
  font-size: 12px;
}

.dimension-row > span:first-child {
  color: var(--muted);
}

.dimension-row b {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 500;
  text-align: right;
}

.score-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.score-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.sin-list .score-track i {
  background: linear-gradient(90deg, #6d7f98, var(--shadow));
}

.virtue-list .score-track i {
  background: linear-gradient(90deg, #9e2f4c, var(--light-soft));
}

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

.tension-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.tension-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
}

.tension-top b {
  font-family: Georgia, serif;
  font-weight: 500;
}

.tension-item p {
  margin: 7px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
}

.depth-grid {
  display: grid;
  gap: 14px;
}

.detail-card.shadow-detail {
  border-top: 2px solid var(--shadow-soft);
}

.detail-card.light-detail {
  border-top: 2px solid var(--light);
}

.detail-score {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}

.detail-score b {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 500;
}

.detail-score span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}

.detail-block {
  margin-top: 17px;
}

.detail-block h4 {
  margin: 0 0 5px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.detail-block p {
  margin: 0;
}

.action-list {
  display: grid;
  gap: 13px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.action-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 11px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.action-list b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(239, 98, 126, 0.3);
  border-radius: 50%;
  color: var(--light-soft);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 500;
}

.disclaimer-card {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.018);
}

.disclaimer-card h3 {
  font-size: 15px;
}

.disclaimer-card p {
  font-size: 11px;
}

.result-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 38px);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(33, 23, 28, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 640px) {
  .app-shell {
    padding-right: 28px;
    padding-left: 28px;
  }

  .landing-screen {
    padding-right: 42px;
    padding-left: 42px;
  }

  .access-card,
  .question-card {
    padding: 30px;
  }

  .dimension-columns,
  .depth-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-dossier,
  .radar-card,
  .narrative-card,
  .dimension-card,
  .tension-card,
  .detail-card,
  .action-card,
  .disclaimer-card {
    padding: 30px;
  }
}

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