* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f3f5f9;
  color: #1f2430;
}

.container {
  width: min(920px, 94vw);
  margin: 18px auto 40px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(20px, 4.5vw, 30px);
}

.hero p {
  margin: 0 0 16px;
  color: #b9c0ff;
}

.card {
  background: #ffffff;
  border: 1px solid #dfe3ed;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.single-col {
  grid-template-columns: 1fr;
}

.opt {
  border: 1px solid #d4daea;
  border-radius: 10px;
  padding: 15px 14px;
  cursor: pointer;
  background: #ffffff;
  color: #202531;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  line-height: 1.45;
}

.opt.active {
  border-color: #6f7dff;
  background: #eef1ff;
}

.opt-letter {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #aeb8da;
  font-size: 12px;
  color: #586082;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.actions-single {
  display: block;
}

.submit-full {
  width: 100%;
  font-size: 17px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}

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

.primary {
  background: #6f7dff;
  color: #fff;
}

.ghost {
  background: #eef1f8;
  color: #2d3654;
  border: 1px solid #d6dceb;
}

.muted {
  color: #6b7284;
  font-size: 14px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bar-wrap {
  width: 100%;
  height: 8px;
  background: #e7ebf4;
  border-radius: 999px;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: linear-gradient(90deg, #6f7dff, #9f7cff);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #edf0ff;
  color: #4c5fcc;
}

.start-shell {
  min-height: 68vh;
  display: grid;
  place-items: center;
}

.start-card {
  width: min(520px, 100%);
  background: #ffffff;
  color: #121212;
  border: 1px solid #dfe3ed;
  border-radius: 22px;
  padding: 42px 20px 26px;
  text-align: center;
}

.start-title {
  margin: 8px 0 14px;
  font-size: clamp(30px, 9vw, 46px);
  line-height: 1.2;
  font-weight: 900;
}

.start-subtitle {
  margin: 0 0 24px;
  color: #4e4e57;
  font-size: 18px;
}

.start-btn {
  background: #0f0f10;
  color: #fff;
  border-radius: 16px;
  width: min(280px, 90%);
  padding: 14px 18px;
  font-size: 24px;
  font-weight: 700;
}

.start-sign {
  margin-top: 22px;
  color: #767680;
  font-size: 15px;
}

.disclaimer {
  margin-top: 16px;
  margin-bottom: 0;
  color: #6b7284;
  font-size: 13px;
  line-height: 1.5;
}

.test-shell {
  margin-top: 8px;
}

.progress-sticky-wrap {
  position: sticky;
  top: max(0px, env(safe-area-inset-top));
  z-index: 40;
  background: #f3f5f9;
  padding-top: 8px;
  padding-bottom: 10px;
}

.progress-card {
  padding: 12px 14px;
  margin-bottom: 0;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 16px rgba(71, 84, 126, 0.12);
}

.progress-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  flex: 1;
  height: 10px;
  background: #e6ebf6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #95a0ff, #6f7dff);
}

.q-index {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d1d8eb;
  background: #f4f6fc;
  color: #4e587f;
  font-size: 13px;
}

.q-title {
  margin: 0 0 14px;
  font-size: clamp(20px, 4.6vw, 28px);
  line-height: 1.45;
}

.q-title + .options {
  margin-top: 4px;
}

.result-card {
  text-align: center;
}

.result-card .q-title,
.result-card .pattern-summary,
.result-card .top3-block,
.result-card .qr-copy-sub,
.result-card .dim-details {
  display: none;
}

.result-line-1 {
  margin: 4px 0 10px;
  color: #3d4664;
  font-weight: 600;
}

.result-line-2 {
  margin: 0 0 16px;
  font-size: clamp(32px, 9vw, 52px);
  line-height: 1.15;
}

.result-image-slot {
  width: min(360px, 100%);
  margin: 0 auto 18px;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  border: 1px solid #d6dcec;
  background: linear-gradient(145deg, #f5f7fd, #e9eefb);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.result-role-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-image-label {
  margin: 0;
  color: #4f5b84;
  font-size: 15px;
}

.qr-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 auto 14px;
  max-width: min(340px, 100%);
  text-align: left;
}

.qr-image {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  border: 1px solid #d6dcec;
  background: #fff;
  object-fit: contain;
}

.qr-copy {
  flex: 1;
  min-width: 0;
}

.qr-copy-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: #2d3654;
  line-height: 1.35;
}

.qr-copy-sub {
  margin: 0;
  font-size: 13px;
  color: #6b7284;
  line-height: 1.45;
}

.pattern-summary {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.dim-details {
  display: none;
}

.dim-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

.dim-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eef1f8;
  font-size: 13px;
}

.dim-row:last-child {
  border-bottom: 0;
}

.dim-name {
  color: #4e587f;
}

.dim-val {
  font-weight: 700;
  color: #2d3654;
}

.dim-sum {
  font-weight: 400;
  color: #9aa3b8;
  font-size: 12px;
}

.top3-block {
  margin-top: 8px;
  text-align: left;
}

.top3-list {
  margin: 6px 0 0;
  padding-left: 1.2em;
}

@media (min-width: 768px) {
  .container {
    margin-top: 30px;
  }

  .start-card {
    padding: 48px 28px 30px;
  }
}
