:root {
  --paper: #f7f4ee;
  --ink: #20201d;
  --muted: #6f6a61;
  --line: rgba(32, 32, 29, 0.14);
  --gold: #b88b4a;
  --green: #607466;
  --clay: #9e6b52;
  --blue: #465d75;
  --white: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 80px rgba(43, 35, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(96, 116, 102, 0.16), transparent 34%),
    linear-gradient(300deg, rgba(70, 93, 117, 0.12), transparent 38%),
    var(--paper);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
}

button {
  font: inherit;
}

input {
  font: inherit;
}

.auth-locked .app-shell {
  opacity: 0;
  pointer-events: none;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(96, 116, 102, 0.18), transparent 34%),
    linear-gradient(300deg, rgba(70, 93, 117, 0.14), transparent 38%),
    var(--paper);
}

.access-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  background: var(--white);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.access-card h2 {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 500;
  line-height: 1.16;
}

.access-card p {
  color: var(--muted);
  line-height: 1.75;
}

.access-card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 24px;
}

.access-card input {
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.access-card input:focus {
  outline: 2px solid rgba(32, 32, 29, 0.16);
  border-color: rgba(32, 32, 29, 0.38);
}

.access-error {
  min-height: 24px;
  margin: 14px 0 0;
  color: #9e4b3e !important;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0;
}

.hero {
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.75fr);
  align-items: center;
  gap: 56px;
}

.eyebrow,
.block-kicker,
.question-index,
.meta {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 88px;
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  color: #3d3a35;
  font-size: 28px;
  line-height: 1.5;
}

.hero__actions,
.nav-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn {
  min-height: 46px;
  border-radius: 6px;
  padding: 0 20px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

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

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.4);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.hero__panel {
  display: grid;
  gap: 14px;
}

.market-card,
.question-card,
.progress-panel,
.result-block,
.insight-panel,
.chapter-block,
.final-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.market-card {
  min-height: 148px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.market-card strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 500;
}

.market-card em {
  color: var(--muted);
  font-style: normal;
}

.hidden {
  display: none !important;
}

.test-layout {
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.progress-panel,
.question-card {
  padding: 28px;
}

.progress-panel {
  position: sticky;
  top: 32px;
  height: max-content;
}

.progress-panel h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
}

.progress-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 32, 29, 0.09);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--clay));
  transition: width 240ms ease;
}

.progress-text {
  margin-top: 14px;
}

.question-card {
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

.question-card h2 {
  max-width: 780px;
  margin-bottom: 28px;
  font-size: 42px;
  font-weight: 500;
  line-height: 1.24;
}

.options {
  display: grid;
  gap: 12px;
  margin-bottom: 26px;
}

.option-btn {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.option-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(32, 32, 29, 0.34);
}

.option-btn.is-selected {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
}

.option-key {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 13px;
}

.option-btn.is-selected .option-key {
  color: #fff;
  background: var(--ink);
}

.option-text {
  font-size: 18px;
  line-height: 1.45;
}

.question-card .nav-row {
  margin-top: auto;
  justify-content: space-between;
}

.result {
  padding: 28px 0 64px;
}

.result-hero {
  max-width: 860px;
  margin-bottom: 28px;
}

.result-hero h2 {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 72px;
  font-weight: 500;
  line-height: 1;
}

.result-hero p:last-child {
  color: #3d3a35;
  font-size: 21px;
  line-height: 1.65;
}

.chapter-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
  gap: 14px;
}

.chapter-block {
  padding: 26px;
}

.chapter-block h3 {
  margin: 18px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.16;
}

.chapter-block p,
.final-message p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.story-block {
  grid-row: span 2;
}

.story-block p {
  margin-bottom: 14px;
}

.quote-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(32, 32, 29, 0.92);
  color: #fff;
}

.quote-block .block-kicker {
  color: rgba(255, 255, 255, 0.58);
}

.quote-block blockquote {
  margin: 18px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.35;
}

.final-message {
  margin-top: 18px;
  padding: 26px;
}

.final-message p:last-child {
  margin-bottom: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.result-block {
  min-height: 250px;
  padding: 22px;
}

.result-block h3 {
  margin: 20px 0 14px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

.result-block p,
.insight-panel p {
  color: var(--muted);
  line-height: 1.75;
}

.insight-panel {
  margin-top: 14px;
  padding: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.result-actions {
  margin-top: 24px;
}

@media (max-width: 880px) {
  .app-shell {
    width: min(100% - 28px, 680px);
    padding: 24px 0;
  }

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

  .access-card h2 {
    font-size: 34px;
  }

  .hero,
  .test-layout,
  .chapter-layout,
  .result-grid,
  .insight-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    gap: 28px;
    padding: 24px 0 40px;
  }

  h1 {
    font-size: 62px;
  }

  .lead {
    font-size: 21px;
  }

  .question-card h2 {
    font-size: 30px;
  }

  .result-hero h2 {
    font-size: 44px;
  }

  .chapter-block h3,
  .quote-block blockquote {
    font-size: 28px;
  }

  .story-block {
    grid-row: auto;
  }

  .test-layout {
    min-height: auto;
  }

  .progress-panel {
    position: static;
  }

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

  .option-text {
    font-size: 16px;
  }
}
