:root {
  --ink: #17201b;
  --ink-soft: #26332c;
  --muted: #68746c;
  --faint: #8f988f;
  --line: #d9ded4;
  --line-strong: #c7cec4;
  --paper: #f6f2e8;
  --paper-2: #eee8da;
  --panel: #fffdf8;
  --panel-soft: #fbf7ed;
  --sage: #79a48e;
  --sage-dark: #315749;
  --gold: #d8a943;
  --gold-soft: #f5e3ae;
  --clay: #c87561;
  --blue: #647f9b;
  --shadow: 0 18px 46px rgba(23, 32, 27, 0.11);
  --shadow-soft: 0 10px 24px rgba(23, 32, 27, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  touch-action: manipulation;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 32, 27, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(23, 32, 27, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #faf8f1 0%, var(--paper) 42%, #efe7d7 100%);
  background-size: 30px 30px, 30px 30px, auto;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  touch-action: manipulation;
}

button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(216, 169, 67, 0.42);
  outline-offset: 3px;
}

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

h1,
h2,
h3 {
  color: var(--ink);
}

h1 {
  font-size: clamp(34px, 5.1vw, 64px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.06;
  margin-bottom: 18px;
}

.no-break {
  white-space: nowrap;
}

.hero-title-line {
  display: block;
}

.mobile-title-line {
  display: inline;
}

h2 {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.24;
}

p {
  color: var(--ink-soft);
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  align-items: center;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(23, 32, 27, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(23, 32, 27, 0.06);
  display: flex;
  justify-content: space-between;
  margin: 0 auto 18px;
  max-width: 1160px;
  padding: 10px 12px;
}

.immersive-screen .topbar {
  display: none;
}

.brand {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px 4px 4px;
  text-align: left;
}

.brand:hover {
  background: rgba(23, 32, 27, 0.04);
}

.brand-mark {
  height: 42px;
  width: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.screen {
  margin: 0 auto;
  max-width: 1160px;
}

.home-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
}

.home-stack {
  display: grid;
  gap: 18px;
}

.hero-panel,
.form-panel,
.test-panel,
.loading-panel,
.report-side,
.report-body {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.97), rgba(251, 247, 237, 0.94)),
    var(--panel);
  isolation: isolate;
  min-height: 590px;
  overflow: hidden;
  padding: clamp(30px, 6vw, 76px);
  position: relative;
}

.user-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(640px, calc(100vh - 128px));
}

.hero-panel::before {
  content: none;
}

.hero-panel::after {
  background:
    radial-gradient(circle at 78% 49%, rgba(200, 117, 97, 0.2) 0 6px, transparent 7px),
    radial-gradient(circle at 63% 58%, rgba(216, 169, 67, 0.25) 0 9px, transparent 10px),
    radial-gradient(circle at 84% 66%, rgba(121, 164, 142, 0.26) 0 13px, transparent 14px),
    radial-gradient(circle at 57% 76%, rgba(100, 127, 155, 0.18) 0 8px, transparent 9px),
    radial-gradient(circle at 72% 84%, rgba(49, 87, 73, 0.2) 0 7px, transparent 8px),
    linear-gradient(138deg, transparent 0 52%, rgba(49, 87, 73, 0.09) 53% 54%, transparent 55%),
    linear-gradient(28deg, transparent 0 57%, rgba(216, 169, 67, 0.11) 58% 59%, transparent 60%),
    linear-gradient(86deg, transparent 0 69%, rgba(100, 127, 155, 0.08) 70% 71%, transparent 72%),
    radial-gradient(ellipse at 76% 76%, rgba(121, 164, 142, 0.1), transparent 30%),
    radial-gradient(ellipse at 66% 88%, rgba(216, 169, 67, 0.08), transparent 28%);
  content: "";
  inset: 0;
  -webkit-mask-image: radial-gradient(
    ellipse at 76% 73%,
    #000 0 26%,
    rgba(0, 0, 0, 0.66) 39%,
    transparent 63%
  );
  mask-image: radial-gradient(
    ellipse at 76% 73%,
    #000 0 26%,
    rgba(0, 0, 0, 0.66) 39%,
    transparent 63%
  );
  opacity: 0.72;
  pointer-events: none;
  position: absolute;
  transform: none;
  z-index: 0;
}

.user-hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  align-items: center;
  color: var(--sage-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 14px;
}

.eyebrow::before {
  background: var(--gold);
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 7px;
  margin-right: 8px;
  width: 7px;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  font-weight: 520;
  line-height: 1.75;
  max-width: 620px;
}

.lead.compact {
  margin-top: 8px;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.question-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  max-width: 680px;
}

.question-strip span {
  background: rgba(121, 164, 142, 0.1);
  border: 0;
  border-radius: 999px;
  color: var(--sage-dark);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
  padding: 8px 11px;
}

.safety-note {
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-left: 4px solid rgba(121, 164, 142, 0.72);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
  margin: 22px 0 0;
  max-width: 560px;
  padding: 10px 12px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.text-link-button {
  background: transparent;
  border: 0;
  color: var(--sage-dark);
  font-size: 14px;
  font-weight: 850;
  min-height: 32px;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(49, 87, 73, 0.28);
  text-underline-offset: 4px;
}

.text-link-button:hover {
  color: var(--ink);
  text-decoration-color: rgba(23, 32, 27, 0.48);
}

.topic-panel {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.95), rgba(251, 247, 237, 0.94)),
    var(--panel);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: clamp(24px, 4vw, 38px);
  position: relative;
}

.topic-panel::before {
  background: linear-gradient(180deg, var(--sage), var(--gold));
  border-radius: 999px;
  content: "";
  height: calc(100% - 40px);
  left: 0;
  position: absolute;
  top: 20px;
  width: 5px;
}

.topic-panel .theme-index {
  margin-bottom: 12px;
}

.topic-panel h2 {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 12px;
}

.topic-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 0;
  max-width: 640px;
}

.topic-select-panel {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.97), rgba(251, 247, 237, 0.94)),
    var(--panel);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 48px) clamp(24px, 5vw, 48px) 110px;
  position: relative;
}

.topic-select-panel > .back-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 16px;
  min-height: 30px;
  padding: 0;
}

.topic-select-panel > .back-button:hover {
  background: transparent;
  color: var(--ink);
}

.topic-select-panel h1 {
  font-size: clamp(34px, 5vw, 56px);
  margin-bottom: 8px;
  max-width: 760px;
}

.topic-select-intro {
  color: var(--muted);
  font-size: 17px;
  font-weight: 560;
  line-height: 1.4;
  margin: 0;
  max-width: 620px;
}

.setup-grid {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  margin-top: 16px;
  max-width: none;
  min-width: 0;
  width: 100%;
}

.topic-select-panel .profile-form {
  margin-top: 0;
}

.future-topic-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.topic-choice-section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.floating-start-bar {
  bottom: 22px;
  display: flex;
  justify-content: center;
  left: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  z-index: 60;
}

.floating-start-bar .primary-button {
  box-shadow: 0 18px 40px rgba(23, 32, 27, 0.22);
  border-radius: 999px;
  min-height: 48px;
  min-width: 144px;
  pointer-events: auto;
  padding: 10px 22px;
}

.floating-start-bar .primary-button:disabled {
  background: #a9aea8;
  box-shadow: 0 10px 24px rgba(23, 32, 27, 0.12);
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
}

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

.topic-option {
  background:
    linear-gradient(90deg, rgba(255, 253, 248, 0.96), rgba(255, 253, 248, 0.82)),
    var(--topic-bg, rgba(255, 253, 248, 0.9));
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  isolation: isolate;
  max-width: 100%;
  min-height: 112px;
  min-width: 0;
  overflow: hidden;
  padding: 18px 20px;
  position: relative;
}

.topic-option::before {
  background: var(--line);
  border-radius: 999px;
  content: "";
  height: calc(100% - 28px);
  left: 0;
  position: absolute;
  top: 14px;
  width: 4px;
  z-index: 2;
}

.topic-option::after {
  background: var(--topic-art, radial-gradient(circle, rgba(121, 164, 142, 0.2), transparent 68%));
  border-radius: 999px;
  bottom: -42px;
  content: "";
  height: 150px;
  opacity: 0.95;
  pointer-events: none;
  position: absolute;
  right: -24px;
  transform: rotate(-8deg);
  width: 230px;
  z-index: 0;
}

.topic-option h2,
.topic-option p,
.topic-option small,
.topic-option .status-badge {
  position: relative;
  z-index: 2;
}

.topic-art-reliable {
  --topic-bg: linear-gradient(135deg, #f8f4e7 0%, #e5f0e5 100%);
  --topic-art:
    radial-gradient(circle at 24% 28%, rgba(49, 87, 73, 0.22) 0 9px, transparent 10px),
    radial-gradient(circle at 64% 58%, rgba(216, 169, 67, 0.25) 0 13px, transparent 14px),
    linear-gradient(135deg, transparent 0 34%, rgba(121, 164, 142, 0.22) 35% 48%, transparent 49%),
    linear-gradient(42deg, transparent 0 42%, rgba(49, 87, 73, 0.2) 43% 55%, transparent 56%);
}

.topic-art-love {
  --topic-bg: linear-gradient(135deg, #fff3ee 0%, #f7ece6 48%, #f2eadf 100%);
  --topic-art:
    radial-gradient(circle at 32% 36%, rgba(200, 117, 97, 0.3) 0 16px, transparent 17px),
    radial-gradient(circle at 66% 34%, rgba(216, 169, 67, 0.2) 0 12px, transparent 13px),
    radial-gradient(circle at 56% 66%, rgba(200, 117, 97, 0.18) 0 22px, transparent 23px),
    linear-gradient(90deg, rgba(200, 117, 97, 0.16), transparent 70%);
}

.topic-art-change {
  --topic-bg: linear-gradient(135deg, #f8f4e7 0%, #e7eef2 100%);
  --topic-art:
    linear-gradient(135deg, transparent 0 32%, rgba(100, 127, 155, 0.22) 33% 44%, transparent 45%),
    radial-gradient(circle at 32% 68%, rgba(100, 127, 155, 0.24) 0 11px, transparent 12px),
    radial-gradient(circle at 66% 34%, rgba(121, 164, 142, 0.22) 0 18px, transparent 19px),
    conic-gradient(from 210deg, rgba(100, 127, 155, 0.22), transparent 42%, rgba(216, 169, 67, 0.18), transparent 72%);
}

.topic-art-pattern {
  --topic-bg: linear-gradient(135deg, #f6f2e8 0%, #ece5d7 48%, #edf0e8 100%);
  --topic-art:
    repeating-radial-gradient(circle at 54% 50%, rgba(49, 87, 73, 0.16) 0 2px, transparent 3px 16px),
    radial-gradient(circle at 28% 36%, rgba(216, 169, 67, 0.22) 0 10px, transparent 11px),
    radial-gradient(circle at 70% 62%, rgba(200, 117, 97, 0.18) 0 14px, transparent 15px);
}

.topic-option.selectable {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.topic-option.selectable:hover {
  border-color: rgba(49, 87, 73, 0.26);
  box-shadow: 0 10px 22px rgba(23, 32, 27, 0.07);
  transform: translateY(-1px);
}

.topic-option.selected {
  border-color: rgba(49, 87, 73, 0.34);
  box-shadow: var(--shadow-soft);
}

.topic-option.selected::before {
  background: linear-gradient(180deg, var(--sage), var(--gold));
}

.topic-option.disabled {
  border-color: rgba(23, 32, 27, 0.1);
  opacity: 1;
}

.topic-option.disabled h2 {
  color: var(--muted);
}

.topic-option.compact {
  align-items: center;
  display: flex;
  min-height: 72px;
  padding: 18px 20px;
}

.topic-option h2 {
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 8px;
  padding-right: 0;
}

.topic-option.compact h2 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  padding-right: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-option p {
  color: var(--muted);
  line-height: 1.62;
  margin-bottom: 0;
  max-width: 620px;
}

.topic-option .primary-button {
  margin-top: 10px;
}

.status-badge {
  background: #1f3d34;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 10px;
  padding: 7px 10px;
}

.status-badge.muted {
  background: rgba(23, 32, 27, 0.1);
  color: var(--muted);
}

.setup-form-card {
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  box-shadow: none;
  display: grid;
  gap: 14px;
  padding: 18px;
  position: relative;
  z-index: 3;
}

.setup-form-card .eyebrow {
  margin-bottom: 0;
}

.field-note {
  background: rgba(121, 164, 142, 0.1);
  border-left: 4px solid rgba(121, 164, 142, 0.72);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
  margin: 0;
  padding: 10px 12px;
}

.theme-list {
  display: grid;
  gap: 12px;
}

.theme-card {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  min-height: 148px;
  padding: 20px;
  position: relative;
}

.theme-card::before {
  background: var(--line);
  border-radius: 999px;
  content: "";
  height: calc(100% - 40px);
  left: 0;
  position: absolute;
  top: 20px;
  width: 3px;
}

.theme-card.active {
  background: #fffdf8;
  border-color: rgba(49, 87, 73, 0.35);
  box-shadow: var(--shadow-soft);
}

.theme-card.active::before {
  background: var(--sage);
}

.theme-card.disabled {
  opacity: 0.58;
}

.theme-card.calibration {
  background: #17201b;
  border-color: rgba(23, 32, 27, 0.84);
  color: #fff;
}

.theme-card.calibration::before {
  background: var(--gold);
}

.theme-index {
  color: var(--clay);
  display: block;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  margin-bottom: 18px;
}

.theme-card h2 {
  margin-bottom: 10px;
}

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

.theme-card.calibration p,
.theme-card.calibration .theme-index {
  color: rgba(255, 255, 255, 0.72);
}

.theme-card.calibration h2 {
  color: #fff;
}

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

.calibration-grid button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  min-height: 40px;
  padding: 8px 10px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.calibration-grid button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.ghost-button,
.back-button {
  align-items: center;
  border-radius: var(--radius);
  border: 1px solid transparent;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.primary-button {
  background: var(--ink);
  box-shadow: 0 10px 22px rgba(23, 32, 27, 0.14);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: #22332a;
  box-shadow: 0 14px 28px rgba(23, 32, 27, 0.18);
  transform: translateY(-1px);
}

.secondary-button {
  background: #fffdf8;
  border-color: var(--line-strong);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  background: var(--panel-soft);
  border-color: rgba(49, 87, 73, 0.34);
  transform: translateY(-1px);
}

.ghost-button,
.back-button {
  background: rgba(255, 253, 248, 0.66);
  border-color: rgba(23, 32, 27, 0.08);
  color: var(--ink);
  min-height: 40px;
}

.ghost-button:hover,
.back-button:hover {
  background: rgba(49, 87, 73, 0.08);
  border-color: rgba(49, 87, 73, 0.18);
}

.full-width {
  width: 100%;
}

.form-panel {
  margin: 0 auto;
  max-width: 640px;
  padding: clamp(24px, 5vw, 46px);
}

.form-panel h1 {
  font-size: clamp(32px, 5vw, 48px);
}

.profile-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

label span {
  color: var(--ink-soft);
  display: block;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
}

input,
select {
  background: #fffdf8;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 52px;
  padding: 0 14px;
  width: 100%;
}

input::placeholder {
  color: var(--faint);
}

input:focus,
select:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(121, 164, 142, 0.12);
}

.test-panel {
  min-height: calc(100vh - 118px);
  padding: clamp(16px, 4vw, 34px);
  position: relative;
}

.progress-wrap {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: min(390px, 55vw);
}

#progressLabel {
  color: var(--sage-dark);
  font-weight: 950;
  white-space: nowrap;
}

.progress-track {
  background: #e6e3d7;
  border: 1px solid rgba(23, 32, 27, 0.05);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  width: 100%;
}

.progress-bar {
  background: linear-gradient(90deg, var(--sage), var(--gold));
  border-radius: 999px;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.question-box {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 960px;
}

.question-box h1 {
  font-size: clamp(30px, 5.8vw, 54px);
  max-width: 780px;
}

.scenario {
  color: #334139;
  font-size: 18px;
  line-height: 1.75;
  margin-bottom: 6px;
  max-width: 820px;
}

.answer-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.answer-card {
  background: #fffdf8;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 226px;
  padding: 18px;
  position: relative;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.answer-card::before {
  background: var(--line-strong);
  border-radius: 999px;
  content: "";
  height: 4px;
  left: 18px;
  position: absolute;
  right: 18px;
  top: 14px;
}

.answer-card[data-answer="A"]::before {
  background: var(--sage);
}

.answer-card[data-answer="middle"]::before {
  background: var(--gold);
}

.answer-card[data-answer="B"]::before {
  background: var(--clay);
}

.answer-card:hover,
.answer-card.selected {
  border-color: rgba(49, 87, 73, 0.45);
  box-shadow: 0 16px 30px rgba(23, 32, 27, 0.1);
  transform: translateY(-2px);
}

.answer-card.selected {
  background: #fbf8ef;
}

.answer-card.selected::after {
  align-items: center;
  background: var(--ink);
  border-radius: 999px;
  color: #fff;
  content: "已选";
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  padding: 0 10px;
  position: absolute;
  right: 14px;
  top: 26px;
}

.answer-card span {
  display: block;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.32;
  margin: 18px 0 12px;
  padding-right: 44px;
}

.answer-card small {
  color: var(--muted);
  display: block;
  font-size: 14px;
  font-weight: 520;
  line-height: 1.68;
}

.answer-card.middle {
  background: #f7f1df;
}

.test-footer {
  display: grid;
  gap: 14px;
  margin: 28px auto 0;
  max-width: 960px;
}

.test-progress-row {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(220px, 1fr);
}

.test-meta-row {
  align-items: stretch;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(23, 32, 27, 0.08);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
  padding: 14px;
}

.test-button-row {
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.test-button-row button {
  min-width: 132px;
}

.test-mechanism {
  margin: 0;
  white-space: nowrap;
}

.test-exit-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  justify-self: center;
  min-height: 32px;
  padding: 0 10px;
}

.test-exit-button:hover {
  background: transparent;
  color: var(--ink);
}

.loading-panel {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 118px);
  padding: 30px;
  text-align: center;
}

.pulse-mark {
  animation: pulse 1.7s ease-in-out infinite;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(23, 32, 27, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
  padding: 14px;
}

.pulse-mark img {
  height: 72px;
  width: 72px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

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

.report-side,
.report-body {
  padding: clamp(18px, 4vw, 32px);
}

.report-side {
  align-self: start;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(249, 244, 232, 0.96)),
    var(--panel);
  position: sticky;
  top: 86px;
}

.report-side h1 {
  font-size: 29px;
  line-height: 1.18;
  margin-bottom: 20px;
}

.score-grid {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.score-pill {
  background: #fffdf8;
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(23, 32, 27, 0.04);
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
}

.score-pill-head {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
}

.score-pill strong {
  font-size: 14px;
  font-weight: 950;
  line-height: 1.38;
}

.rating-badge {
  background: #1f3d34;
  border-radius: 999px;
  color: #fff;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

.score-pill small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.report-body {
  background: #fffdf8;
  font-size: 17px;
  line-height: 1.88;
  overflow: hidden;
  position: relative;
}

.report-bottom-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.share-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  min-width: 88px;
}

.report-body::before {
  content: none;
}

.report-body > p:first-child {
  color: var(--ink);
  font-size: 20px;
  font-weight: 760;
  line-height: 1.72;
}

.report-context {
  background: rgba(121, 164, 142, 0.1);
  border: 1px solid rgba(49, 87, 73, 0.14);
  border-left: 4px solid rgba(121, 164, 142, 0.72);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
  padding: 10px 12px;
}

.report-body h2 {
  align-items: center;
  background: #f4efe2;
  border: 1px solid rgba(23, 32, 27, 0.08);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  display: flex;
  font-size: 22px;
  line-height: 1.35;
  margin: 36px 0 16px;
  min-height: 54px;
  padding: 12px 15px;
}

.report-body p {
  margin-bottom: 18px;
}

.report-body strong {
  background: linear-gradient(transparent 58%, rgba(245, 227, 174, 0.86) 58%);
  font-weight: 950;
}

.password-card {
  background: #fbf8ef;
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(23, 32, 27, 0.05);
  margin: 14px 0;
  padding: 18px 19px 16px;
  position: relative;
}

.password-card::before {
  background: var(--sage);
  border-radius: 999px;
  content: "";
  height: calc(100% - 28px);
  left: 0;
  position: absolute;
  top: 14px;
  width: 4px;
}

.password-card h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.45;
  margin: 0 0 10px;
  padding-left: 6px;
}

.password-card p {
  margin-bottom: 12px;
}

.password-card p:last-child {
  margin-bottom: 0;
}

.password-card em {
  background: rgba(216, 169, 67, 0.22);
  border-radius: 999px;
  color: var(--ink);
  display: inline-block;
  font-style: normal;
  font-weight: 950;
  line-height: 1.2;
  margin-right: 4px;
  padding: 3px 8px;
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.history-item {
  align-items: center;
  background: #fffdf8;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
}

.history-item-main {
  min-width: 0;
}

.history-item strong,
.history-item small {
  display: block;
}

.history-item strong {
  font-weight: 900;
}

.history-item small {
  color: var(--muted);
  margin-top: 4px;
}

.history-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.history-actions .secondary-button {
  min-height: 38px;
  padding: 8px 14px;
}

.text-danger-button {
  background: transparent;
  border: 1px solid rgba(200, 117, 97, 0.34);
  border-radius: var(--radius);
  color: var(--clay);
  font-size: 14px;
  font-weight: 900;
  min-height: 38px;
  min-width: auto;
  padding: 8px 10px;
}

.text-danger-button:hover {
  background: rgba(200, 117, 97, 0.08);
  border-color: rgba(200, 117, 97, 0.52);
}

.text-danger-button.solid {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
  min-width: 76px;
}

.text-danger-button.solid:hover {
  background: #b96553;
  border-color: #b96553;
}

.confirm-overlay {
  align-items: center;
  background: rgba(23, 32, 27, 0.36);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 120;
}

.confirm-dialog {
  background: #fffdf8;
  border: 1px solid rgba(23, 32, 27, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 360px;
  padding: 22px;
  width: min(100%, 360px);
}

.confirm-dialog h2 {
  font-size: 20px;
  line-height: 1.42;
  margin: 0;
}

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

.share-text {
  background: #fbf8ef;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  line-height: 1.55;
  margin-top: 14px;
  min-height: 130px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.share-preview-card {
  background:
    radial-gradient(circle at 82% 18%, rgba(216, 169, 67, 0.22), transparent 28%),
    radial-gradient(circle at 18% 82%, rgba(121, 164, 142, 0.22), transparent 32%),
    linear-gradient(135deg, #fffdf8 0%, #f5efe2 100%);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 132px;
  margin-top: 16px;
  overflow: hidden;
  padding: 20px;
}

.share-preview-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.share-brand {
  color: var(--sage-dark);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: lowercase;
}

.share-preview-main strong {
  color: var(--ink);
  display: block;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.18;
}

.share-preview-main p {
  color: var(--ink-soft);
  line-height: 1.58;
  margin: 0;
}

.share-preview-main small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.share-qr-box {
  align-items: center;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px;
}

.share-qr-box img {
  background: #fff;
  border-radius: 4px;
  display: block;
  height: 112px;
  width: 112px;
}

.share-qr-box span,
.share-helper {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
  text-align: center;
}

.share-helper {
  margin: 12px 0 0;
  text-align: left;
}

.legal-panel {
  background: #fffdf8;
  box-shadow: 0 12px 34px rgba(23, 32, 27, 0.08);
  max-width: 920px;
  padding: clamp(24px, 5vw, 56px);
}

.legal-panel > .back-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 16px;
  min-height: 30px;
  padding: 0;
}

.legal-copy {
  border-top: 1px solid rgba(23, 32, 27, 0.12);
  display: grid;
  gap: 0;
  margin-top: 28px;
}

.legal-copy section {
  background: transparent;
  border-bottom: 1px solid rgba(23, 32, 27, 0.1);
  padding: 22px 0;
}

.legal-copy h2 {
  font-size: 20px;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.legal-copy p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.85;
  margin: 0;
}

.legal-meta {
  color: var(--faint);
  font-size: 14px;
  font-weight: 800;
  margin: -4px 0 18px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

@media (max-width: 920px) {
  .home-grid,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .topic-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

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

  .setup-form-card {
    position: static;
  }

  .topic-options {
    grid-template-columns: 1fr;
  }

  .future-topic-grid {
    grid-template-columns: 1fr;
  }

  .floating-start-bar {
    bottom: 14px;
    left: 12px;
    right: 12px;
  }

  .floating-start-bar .primary-button {
    width: auto;
  }

  .report-side {
    position: static;
  }

  .report-bottom-actions {
    justify-content: stretch;
  }

  .report-bottom-actions button {
    flex: 1;
  }

  .share-status {
    flex-basis: 100%;
    min-width: 0;
    text-align: center;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .hero-panel {
    min-height: auto;
    padding: 30px 22px 96px;
  }

  .user-hero {
    min-height: calc(100vh - 120px);
  }

  .hero-panel::after {
    -webkit-mask-image: radial-gradient(
      ellipse at 68% 82%,
      #000 0 24%,
      rgba(0, 0, 0, 0.52) 38%,
      transparent 61%
    );
    mask-image: radial-gradient(
      ellipse at 68% 82%,
      #000 0 24%,
      rgba(0, 0, 0, 0.52) 38%,
      transparent 61%
    );
    opacity: 0.36;
  }

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

  .answer-card {
    min-height: 142px;
  }

  .topic-select-panel h1 {
    font-size: clamp(30px, 8.2vw, 40px);
  }

  .topic-select-panel {
    padding: 22px 14px 104px;
  }

  .setup-grid {
    gap: 12px;
    margin-top: 12px;
    max-width: 100%;
    width: 100%;
  }

  .setup-form-card {
    gap: 12px;
    padding: 16px;
  }

  .topic-option {
    min-height: 112px;
    padding: 16px;
  }

  .test-progress-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .test-button-row {
    gap: 16px;
  }

  .test-button-row button {
    flex: 1;
    min-width: 0;
  }

  .progress-wrap {
    min-width: 100%;
  }

  .report-body {
    font-size: 16px;
    line-height: 1.82;
  }

  .report-body > p:first-child {
    font-size: 18px;
  }

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

  .history-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    gap: 10px;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .brand-mark {
    height: 38px;
    width: 38px;
  }

  .ghost-button,
  .back-button {
    min-height: 38px;
    padding: 8px 10px;
  }

  h1 {
    font-size: clamp(32px, 10vw, 44px);
  }

  .mobile-title-line {
    display: block;
  }

  .lead,
  .scenario {
    font-size: 16px;
  }

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

  .safety-note {
    font-size: 12px;
  }

  .question-strip span {
    font-size: 13px;
  }

  .report-side,
  .report-body,
  .test-panel,
  .form-panel {
    padding: 18px;
  }

  .score-pill-head {
    flex-direction: column;
  }

  .rating-badge {
    white-space: normal;
  }

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

  .share-qr-box {
    justify-self: start;
    width: 142px;
  }

  .confirm-actions {
    flex-wrap: wrap;
  }
}
