:root {
  --ink: #17191d;
  --muted: #606772;
  --paper: #ffffff;
  --mist: #f1f7f4;
  --line: #20242a;
  --red: #b21f2d;
  --rose: #e04763;
  --jade: #146b5d;
  --sky: #d7eff2;
  --gold: #d7b63b;
  --shadow: 0 18px 54px rgba(23, 25, 29, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(20, 107, 93, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(178, 31, 45, 0.07) 1px, transparent 1px),
    var(--mist);
  background-size: 42px 42px;
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: 0;
}

button {
  cursor: pointer;
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 8em;
  font-size: 56px;
  line-height: 1.02;
}

h2 {
  font-size: 34px;
  line-height: 1.18;
}

h3 {
  font-size: 20px;
  line-height: 1.24;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 28px;
  border-bottom: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 900;
}

.logo span {
  display: inline-grid;
  place-items: center;
  min-width: 90px;
  min-height: 38px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: white;
  background: var(--red);
}

.logo strong {
  font-size: 18px;
}

.shop-mark,
.tag {
  display: inline-flex;
  width: max-content;
  padding: 5px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--gold);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.shop-mark {
  margin-right: auto;
  margin-left: 16px;
}

.tag {
  margin-bottom: 16px;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-weight: 800;
}

.topbar nav a:hover {
  color: var(--red);
}

main {
  width: calc(100% - 36px);
  max-width: 1180px;
  margin: 0 auto;
}

.court-board {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.12fr) 190px;
  gap: 24px;
  align-items: stretch;
  min-height: calc(100vh - 72px);
  padding: 40px 0;
}

.board-copy,
.tester,
.result,
.type-wall,
.faq,
footer {
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.board-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  color: white;
  background:
    linear-gradient(180deg, rgba(23, 25, 29, 0.15), rgba(23, 25, 29, 0.75)),
    url("images/inner-door.jpg") center / cover;
}

.board-copy > p:not(.tag) {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 32px;
}

.stats div {
  min-height: 88px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

.stats strong {
  font-size: 32px;
  line-height: 1;
}

.stats span {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 900;
}

.tester {
  display: flex;
  flex-direction: column;
  min-height: 620px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(215, 239, 242, 0.7), transparent 38%),
    linear-gradient(225deg, rgba(224, 71, 99, 0.11), transparent 42%),
    white;
}

.tester__top,
.tester__controls,
.result__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tester__top {
  color: var(--muted);
  font-weight: 900;
}

.progress {
  height: 14px;
  margin: 18px 0 28px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: white;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--gold), var(--rose));
  transition: width 180ms ease;
}

.question-kicker {
  margin-bottom: 10px;
  color: var(--red);
  font-weight: 900;
}

.tester h2 {
  min-height: 126px;
}

.answers {
  display: grid;
  gap: 14px;
  margin: 26px 0;
}

.answer,
.tester__controls button,
.result__actions button {
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: white;
  font-weight: 900;
  text-align: left;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.answer:hover,
.tester__controls button:hover,
.result__actions button:hover {
  transform: translateY(-2px);
  background: var(--sky);
}

.answer.is-selected {
  color: white;
  background: var(--jade);
}

.answer--start,
.primary {
  color: white;
  background: var(--red);
}

.tester__controls {
  margin-top: auto;
}

.tester__controls button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.tester__hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.mood-strip {
  display: grid;
  gap: 24px;
  align-content: center;
}

.mood-strip img {
  aspect-ratio: 1 / 1;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  background: #222;
  box-shadow: var(--shadow);
}

.mood-strip img:nth-child(1) {
  transform: rotate(-3deg);
}

.mood-strip img:nth-child(2) {
  transform: rotate(3deg);
}

.mood-strip img:nth-child(3) {
  transform: rotate(-2deg);
}

.result {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
  margin: 28px 0 42px;
  padding: 28px;
}

.result[hidden] {
  display: none;
}

.verdict {
  min-height: 320px;
  display: grid;
  align-content: space-between;
  justify-items: center;
  gap: 16px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: white;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(20, 107, 93, 0.4), rgba(178, 31, 45, 0.78)),
    url("images/calligraphy-hall.jpg") center / cover;
}

.result-avatar {
  width: min(100%, 248px);
}

.avatar-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.avatar-svg--large {
  filter: drop-shadow(0 18px 28px rgba(23, 25, 29, 0.28));
}

.verdict__stamp {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius);
  background: rgba(23, 25, 29, 0.48);
  backdrop-filter: blur(8px);
}

.verdict__stamp p {
  padding: 5px 10px;
  border: 2px solid white;
  border-radius: 999px;
  background: rgba(23, 25, 29, 0.42);
  font-size: 13px;
  font-weight: 900;
}

.verdict__stamp strong {
  font-size: 72px;
  line-height: 0.95;
  text-shadow: 0 8px 28px rgba(23, 25, 29, 0.46);
}

.verdict__stamp span {
  font-size: 22px;
  font-weight: 900;
}

.match {
  margin: 12px 0 18px;
  color: var(--red);
  font-weight: 900;
}

.result__copy > p:not(.tag):not(.match):not(.copy-note) {
  color: var(--muted);
  font-size: 18px;
}

.result__actions {
  justify-content: flex-start;
  margin-top: 22px;
}

.copy-note {
  min-height: 24px;
  margin-top: 10px;
  color: var(--jade);
  font-weight: 800;
}

.dimensions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.dim {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fbfffd;
}

.dim__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  font-weight: 900;
}

.dim__bar {
  height: 10px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: white;
}

.dim__bar span {
  display: block;
  height: 100%;
  background: var(--jade);
}

.type-wall,
.faq {
  margin: 42px 0;
  padding: 28px;
}

.section-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-head p:not(.tag) {
  margin-top: 14px;
  color: var(--muted);
}

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

.type-card {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.type-card__avatar {
  display: grid;
  place-items: center;
  min-height: 220px;
}

.type-card__avatar .avatar-svg {
  max-height: 240px;
}

.type-card strong {
  display: inline-grid;
  place-items: center;
  min-width: 62px;
  min-height: 42px;
  margin-bottom: 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: white;
  background: var(--jade);
  font-size: 18px;
}

.type-card:nth-child(3n + 1) strong {
  background: var(--red);
}

.type-card:nth-child(3n + 2) strong {
  color: var(--ink);
  background: var(--gold);
}

.type-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.faq {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 28px;
}

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

details {
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

summary {
  cursor: pointer;
  font-weight: 900;
}

details p {
  margin-top: 10px;
  color: var(--muted);
}

footer {
  width: calc(100% - 36px);
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 42px auto;
  padding: 20px 24px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

footer a {
  color: var(--red);
  font-weight: 900;
}

@media (max-width: 1060px) {
  .court-board {
    grid-template-columns: 1fr;
  }

  .mood-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .mood-strip img:nth-child(n) {
    transform: none;
  }

  .type-grid,
  .dimensions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .shop-mark {
    margin-left: 0;
    margin-top: 8px;
  }

  .topbar nav {
    width: 100%;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 4px;
    white-space: nowrap;
  }

  main,
  footer {
    width: calc(100% - 24px);
    max-width: 1180px;
  }

  .court-board {
    min-height: auto;
    padding: 20px 0;
  }

  .court-board > * {
    width: 100%;
    max-width: 100%;
  }

  .tester {
    order: -1;
  }

  .board-copy,
  .tester,
  .result,
  .type-wall,
  .faq {
    padding: 20px;
  }

  h1 {
    font-size: 38px;
    word-break: break-all;
  }

  h2 {
    font-size: 28px;
  }

  .stats,
  .result,
  .faq,
  .dimensions {
    grid-template-columns: 1fr;
  }

  .tester {
    min-height: 560px;
  }

  .tester h2 {
    min-height: 148px;
    word-break: break-all;
  }

  .tester__top,
  .tester__controls,
  .result__actions {
    flex-wrap: wrap;
  }

  .tester__controls button,
  .result__actions button {
    flex: 1 1 130px;
  }

  .answers,
  .answer {
    width: 100%;
    min-width: 0;
  }

  .mood-strip {
    gap: 12px;
  }

  .type-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .verdict {
    min-height: 250px;
  }

  .result-avatar {
    width: min(100%, 220px);
  }

  .verdict__stamp strong {
    font-size: 58px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}
