:root {
  --red: #d91f26;
  --red-dark: #a70f16;
  --yellow: #ffc72c;
  --ink: #191713;
  --paper: #fffaf0;
  --cream: #f4e6c9;
  --muted: #756d60;
  --white: #fffef9;
  --line: rgba(25, 23, 19, .16);
  --shadow: 0 22px 65px rgba(72, 41, 22, .15);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 199, 44, .32), transparent 28rem),
    linear-gradient(145deg, var(--paper), var(--cream));
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.site-header,
.site-footer,
#app {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 12px 12px 5px 12px;
  font: 1000 24px/1 Arial Black, sans-serif;
  transform: rotate(-3deg);
}

.brand strong,
.brand small { display: block; }
.brand strong { font: 1000 20px/1 Arial Black, sans-serif; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.version { padding: 7px 9px; border: 1px solid var(--line); border-radius: 999px; font: 800 10px/1 monospace; }

#app { min-height: calc(100vh - 174px); padding: 20px 0 64px; }

.site-footer {
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}
.site-footer p { margin: 3px 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 13px; }
.footer-links a { color: var(--ink); font-weight: 900; text-decoration: none; }
.footer-links a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 4px; }

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, .72fr);
  align-items: center;
  gap: clamp(34px, 7vw, 88px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 13px;
  color: var(--red);
  font: 900 12px/1.2 monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(54px, 9vw, 106px);
  line-height: .87;
  letter-spacing: -.075em;
}

.hero h1 em {
  display: block;
  color: var(--red);
  font-style: normal;
  text-shadow: 5px 5px 0 var(--yellow);
}

.hero-lead {
  max-width: 600px;
  margin: 28px 0 0;
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 800;
  line-height: 1.65;
}

.hero-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  min-height: 50px;
  padding: 13px 20px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, .option:focus-visible, .text-link:focus-visible { outline: 4px solid rgba(255, 199, 44, .72); outline-offset: 3px; }
.btn-primary { color: #fff; background: var(--red); box-shadow: 6px 7px 0 var(--yellow); }
.btn-primary:hover { box-shadow: 8px 9px 0 var(--yellow); }
.btn-secondary { color: var(--ink); background: var(--white); }
.btn-dark { color: #fff; background: var(--ink); }
.btn[disabled] { cursor: wait; opacity: .65; transform: none; }

.ticket {
  position: relative;
  overflow: hidden;
  padding: 26px;
  color: #fff;
  background: var(--red);
  border: 4px solid var(--ink);
  border-radius: 24px 24px 8px 24px;
  box-shadow: 13px 15px 0 var(--yellow), var(--shadow);
  transform: rotate(1.8deg);
}

.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 44%;
  width: 26px;
  height: 26px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.ticket::before { left: -16px; }
.ticket::after { right: -16px; }

.ticket-head,
.ticket-row { display: flex; justify-content: space-between; gap: 16px; }
.ticket-head { font: 900 11px/1 monospace; letter-spacing: .08em; }
.ticket-number { margin: 32px 0 3px; color: var(--yellow); font: 1000 95px/.8 Arial Black, sans-serif; letter-spacing: -.08em; }
.ticket-title { margin-bottom: 25px; font-size: 22px; font-weight: 1000; }
.ticket-dash { margin: 20px 0; border-top: 2px dashed rgba(255, 255, 255, .55); }
.ticket-row { padding: 8px 0; font-size: 12px; }
.ticket-row span { color: rgba(255,255,255,.76); }
.ticket-row b { text-align: right; }

.quiz-shell { width: min(760px, 100%); margin: 34px auto 0; }
.quiz-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font: 900 11px/1.2 monospace; }
.progress { height: 9px; margin: 13px 0 23px; overflow: hidden; background: rgba(25, 23, 19, .1); border: 2px solid var(--ink); border-radius: 999px; }
.progress span { display: block; height: 100%; background: var(--red); transition: width .22s ease; }

.question-card {
  padding: clamp(22px, 5vw, 46px);
  background: rgba(255, 254, 249, .9);
  border: 3px solid var(--ink);
  border-radius: 23px;
  box-shadow: 10px 12px 0 rgba(25, 23, 19, .1);
}

.question-card h2 { margin: 0; font-size: clamp(25px, 5vw, 41px); line-height: 1.25; letter-spacing: -.035em; }
.options { display: grid; gap: 10px; margin-top: 30px; }
.option {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px 1fr 20px;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 13px;
  text-align: left;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
  transition: transform .13s ease, background .13s ease, color .13s ease;
}
.option:hover { transform: translateX(4px); background: var(--yellow); }
.option-key { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--red); border: 2px solid var(--ink); border-radius: 9px; font: 1000 13px/1 monospace; }
.option-arrow { font-size: 20px; }
.quiz-tools { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.text-link { padding: 8px 0; color: var(--muted); background: none; border: 0; font-weight: 850; text-decoration: underline; text-underline-offset: 4px; }
.feedback-message { min-height: 20px; margin: 10px 0 0; color: var(--red); font-size: 12px; font-weight: 850; }

.interstitial { min-height: 540px; display: grid; place-items: center; text-align: center; }
.stamp { max-width: 680px; padding: 35px; color: var(--red); border: 7px double var(--red); border-radius: 18px; font-size: clamp(30px, 7vw, 68px); font-weight: 1000; line-height: 1.1; transform: rotate(-2deg); }
.loading-dots::after { content: ""; animation: dots 1.1s infinite steps(4); }
@keyframes dots { 0%{content:""} 25%{content:"."} 50%{content:".."} 75%,100%{content:"..."} }

.result { width: min(920px, 100%); margin: 20px auto 0; }
.result-intro { margin: 0 0 18px; color: var(--muted); font-weight: 700; }
.result-card { overflow: hidden; color: #fff; background: var(--red); border: 4px solid var(--ink); border-radius: 25px; box-shadow: 13px 15px 0 var(--yellow), var(--shadow); }
.result-head { display: flex; justify-content: space-between; gap: 16px; padding: 15px 20px; font: 900 11px/1 monospace; letter-spacing: .08em; }
.result-grid { display: grid; grid-template-columns: minmax(270px, .8fr) minmax(0, 1.2fr); align-items: start; background: var(--white); color: var(--ink); }
.art-placeholder {
  width: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 30px;
  color: var(--muted);
  background:
    linear-gradient(45deg, transparent 48%, rgba(25,23,19,.09) 49%, rgba(25,23,19,.09) 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(25,23,19,.09) 49%, rgba(25,23,19,.09) 51%, transparent 52%),
    var(--cream);
  background-size: 26px 26px;
  border-right: 3px solid var(--ink);
  text-align: center;
}
.persona-art { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--cream); border-right: 3px solid var(--ink); }
.art-icon { width: 88px; height: 88px; display: grid; place-items: center; color: var(--red); background: var(--yellow); border: 4px solid var(--ink); border-radius: 50% 50% 42% 48%; font: 1000 42px/1 Arial Black, sans-serif; transform: rotate(-6deg); }
.art-placeholder strong { color: var(--ink); font-size: 18px; }
.art-placeholder small { max-width: 260px; line-height: 1.55; }
.result-body { padding: clamp(24px, 5vw, 46px); }
.status-pill { display: inline-flex; padding: 8px 11px; color: var(--red); background: rgba(217,31,38,.09); border: 1px solid rgba(217,31,38,.25); border-radius: 999px; font-size: 12px; font-weight: 900; }
.result-code { margin-top: 22px; color: var(--red); font: 1000 clamp(50px, 9vw, 82px)/.8 Arial Black, sans-serif; letter-spacing: -.06em; }
.result-body h1 { margin: 16px 0 12px; font-size: clamp(34px, 6vw, 55px); line-height: 1; letter-spacing: -.055em; }
.family-line { margin: 0 0 22px; color: var(--muted); font-weight: 850; }
.main-joke { margin: 0; padding: 16px 18px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; font-size: clamp(17px, 3vw, 22px); font-weight: 1000; line-height: 1.45; }
.evidence { display: grid; gap: 9px; margin: 18px 0 0; }
.evidence p { margin: 0; padding: 12px 13px; background: var(--paper); border-left: 5px solid var(--red); border-radius: 8px; font-size: 13px; font-weight: 750; line-height: 1.55; }
.result-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.meter { padding: 11px 13px; background: rgba(25,23,19,.06); border-radius: 10px; }
.meter span, .meter b { display: block; }
.meter span { color: var(--muted); font-size: 10px; font-weight: 800; }
.meter b { margin-top: 5px; font-size: 15px; }
.result-qr { width: fit-content; display: flex; align-items: center; gap: 11px; margin: 24px auto 0; padding: 8px 13px 8px 8px; color: var(--ink); background: rgba(255,254,249,.78); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 5px 6px 0 var(--yellow); }
.result-qr img { width: 64px; height: 64px; padding: 4px; background: var(--white); border: 2px solid var(--ink); border-radius: 8px; image-rendering: pixelated; }
.result-qr strong, .result-qr span { display: block; }
.result-qr strong { font-size: 14px; }
.result-qr span { margin-top: 4px; font: 900 13px/1.2 monospace; letter-spacing: .03em; }
.result-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0 0; padding: 0 4px; }
.result-actions .btn { min-height: 50px; padding-inline: 12px; font-size: 13px; }

.details-card { margin-top: 30px; padding: 23px; background: rgba(255,254,249,.72); border: 1px solid var(--line); border-radius: 17px; }
.details-card summary { cursor: pointer; font-weight: 950; }
.details-card p { color: var(--muted); line-height: 1.75; }
.feedback-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.feedback-row .btn { min-height: 42px; padding: 9px 13px; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 30; transform: translateX(-50%); padding: 12px 16px; color: #fff; background: var(--ink); border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; font-weight: 850; }

@media (max-width: 760px) {
  .site-header { min-height: 68px; }
  .brand small { display: none; }
  .version { font-size: 8px; }
  #app { padding-top: 5px; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 34px 0 52px; }
  .hero h1 { font-size: clamp(52px, 16vw, 78px); }
  .ticket { width: min(420px, calc(100% - 13px)); margin-inline: auto; }
  .quiz-shell { margin-top: 12px; }
  .question-card { border-width: 2px; box-shadow: 6px 7px 0 rgba(25,23,19,.1); }
  .option { grid-template-columns: 34px 1fr 16px; min-height: 64px; padding: 10px 11px; font-size: 14px; }
  .result { margin-top: 8px; }
  .result-card { border-width: 3px; box-shadow: 7px 8px 0 var(--yellow); }
  .result-grid { grid-template-columns: 1fr; }
  .art-placeholder, .persona-art { height: auto; aspect-ratio: 1 / 1; border-right: 0; border-bottom: 3px solid var(--ink); }
  .persona-art { object-fit: contain; object-position: center; }
  .result-head { padding: 11px 14px; }
  .result-body { padding: 16px 15px 17px; }
  .status-pill { padding: 6px 9px; font-size: 10px; }
  .result-code { margin-top: 13px; font-size: 48px; }
  .result-body h1 { margin: 10px 0 7px; font-size: 34px; }
  .family-line { margin-bottom: 12px; font-size: 13px; }
  .main-joke { padding: 11px 12px; font-size: 16px; line-height: 1.35; }
  .evidence { gap: 6px; margin-top: 11px; }
  .evidence p { padding: 8px 9px; border-left-width: 4px; font-size: 11px; line-height: 1.4; }
  .result-meters { gap: 7px; margin-top: 11px; }
  .meter { padding: 8px 9px; }
  .meter b { font-size: 13px; }
  .result-qr { gap: 8px; margin-top: 18px; padding: 6px 10px 6px 6px; }
  .result-qr img { width: 48px; height: 48px; padding: 3px; }
  .result-qr strong { font-size: 12px; }
  .result-qr span { font-size: 12px; }
  .result-actions { grid-template-columns: 1fr; gap: 9px; margin-top: 22px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
