.app {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 20px 52px;
}

.stage {
  animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 通用按钮 ---------- */

.btn {
  appearance: none;
  border: 0;
  font: inherit;
  font-size: 15.5px;
  font-weight: 650;
  cursor: pointer;
  border-radius: 999px;
  padding: 15px 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--ink);
  color: #FFF8EC;
  box-shadow: 0 12px 28px rgba(43, 38, 32, 0.18);
}

.btn-primary:hover {
  background: #3A3228;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(43, 38, 32, 0.22);
}

.btn-primary:active {
  transform: translateY(0) scale(0.99);
}

.btn-primary span {
  color: var(--accent-2);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink-dim);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.6);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn:focus-visible,
.back-btn:focus-visible,
.text-btn:focus-visible,
.modal-close:focus-visible {
  outline: 3px solid rgba(217, 111, 58, 0.32);
  outline-offset: 3px;
}

/* ---------- 开场 ---------- */

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 2px 0;
}

.brand {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.18em;
  color: var(--ink-2);
}

.brand-note {
  font-size: 11.5px;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  background: rgba(255, 253, 248, 0.45);
}

.masthead {
  padding: 54px 0 12px;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(50px, 12.5vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 18px 0 22px;
}

.display .hl {
  position: relative;
  display: inline-block;
  color: var(--accent-deep);
  z-index: 0;
}

.display .hl::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -3%;
  bottom: 0.07em;
  height: 0.24em;
  border-radius: 999px;
  background: rgba(240, 180, 92, 0.48);
  transform: rotate(-1.2deg);
  z-index: -1;
}

.lede {
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 34em;
  margin: 0;
}

.lede strong {
  color: var(--ink);
  font-weight: 650;
}

.cta-row {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-line {
  margin: 14px 0 0;
  color: var(--ink-dim);
  font-size: 12.5px;
  letter-spacing: 0.03em;
}

/* ---------- 犬种跑马灯 ---------- */

.marquee {
  margin: 38px -20px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.marquee-row {
  display: flex;
  overflow: hidden;
}

.marquee-row + .marquee-row {
  margin-top: 12px;
}

.marquee-track {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  animation: marquee 48s linear infinite;
  will-change: transform;
}

.marquee-row.reverse .marquee-track {
  animation-direction: reverse;
  animation-duration: 56s;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  padding-right: 12px;
}

.dog-chip {
  flex: 0 0 auto;
  width: 78px;
  text-align: center;
}

.chip-art {
  width: 62px;
  height: 62px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.7);
  box-shadow: 0 4px 14px rgba(96, 69, 38, 0.13);
}

.chip-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dog-chip span {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 说明卡与页脚 ---------- */

.note-card {
  margin-top: 38px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.note-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-2);
  font-size: 18px;
}

.note-card h3 {
  margin: 0 0 5px;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.note-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.foot {
  margin-top: 34px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 11.5px;
  line-height: 1.8;
}

/* ---------- 答题 ---------- */

.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 2px 12px;
}

.back-btn {
  background: none;
  border: 0;
  padding: 8px 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}

.back-btn:disabled {
  visibility: hidden;
}

.progress-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(43, 38, 32, 0.08);
  overflow: hidden;
  margin-bottom: 26px;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.question-card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 36px);
  box-shadow: var(--shadow-lg);
}

.kicker {
  margin: 0 0 14px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.2em;
  color: var(--accent-deep);
}

.question-card h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 5.6vw, 32px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 10px;
}

.question-hint {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-dim);
  margin: 0 0 24px;
}

.question-hint:empty {
  display: none;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: #FFFCF5;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  animation: optionIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  -webkit-tap-highlight-color: transparent;
}

.option:nth-child(2) { animation-delay: 0.035s; }
.option:nth-child(3) { animation-delay: 0.07s; }
.option:nth-child(4) { animation-delay: 0.105s; }

.option:hover {
  border-color: var(--accent);
  background: #FFF8EC;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(217, 111, 58, 0.08);
}

.option:active {
  transform: scale(0.994);
}

.option:focus-visible {
  outline: 3px solid rgba(217, 111, 58, 0.3);
  outline-offset: 2px;
}

.option-letter {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 750;
  color: var(--ink-2);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.option:hover .option-letter,
.option.is-selected .option-letter {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.option-text {
  flex: 1;
}

.option.is-selected {
  border-color: var(--accent);
  background: #FFF3E2;
}

.quiz-foot {
  text-align: center;
  color: var(--ink-dim);
  font-size: 12px;
  margin-top: 20px;
}

/* ---------- 结果页 ---------- */

.result-card {
  --accent: #D96F3A;
  --accent-2: #F0B45C;
  --hero-from: #F0B45C;
  --hero-to: #D96F3A;
}

.result-topline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 6px 2px 12px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-dim);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 158px;
  gap: 10px;
  align-items: center;
  padding: 26px 26px 24px;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(38, 25, 13, 0.4), rgba(38, 25, 13, 0.1));
  pointer-events: none;
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  right: -80px;
  top: -90px;
  pointer-events: none;
}

.hero-copy,
.hero-art {
  position: relative;
  z-index: 1;
}

.hero-copy {
  min-width: 0;
}

.match-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 6px 11px;
  backdrop-filter: blur(6px);
}

.hero-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 7.2vw, 42px);
  line-height: 1.1;
  margin: 14px 0 4px;
  letter-spacing: -0.01em;
}

.hero-copy .en {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-copy .tagline {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.93;
}

.hero-art {
  width: 100%;
  max-width: 166px;
  justify-self: end;
  padding: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-art svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.18));
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  font-size: 11.5px;
  color: var(--ink-2);
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
}

.result-intro {
  font-size: 15px;
  line-height: 1.82;
  color: var(--ink-2);
  margin: 20px 2px 0;
}

.result-section {
  margin-top: 32px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head .section-num {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.16em;
  color: var(--accent-deep);
}

.section-head h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.why-list {
  display: grid;
  gap: 10px;
}

.why-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--ink-2);
  background: rgba(255, 253, 248, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 13px 15px;
}

.why-item::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.fit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fit-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(96, 69, 38, 0.03);
}

.fit-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-bg);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.fit-item strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.fit-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.62;
  color: var(--ink-dim);
}

.watch-list {
  display: grid;
  gap: 10px;
}

.watch-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  padding: 12px 15px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}

.watch-item::before {
  content: "!";
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
}

.risk-callout {
  margin-top: 12px;
  background: var(--amber-bg);
  border: 1px solid rgba(183, 121, 31, 0.24);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.68;
  color: #7A5210;
}

.risk-callout strong {
  display: block;
  margin-bottom: 3px;
  color: #8A5B12;
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 13px 15px;
}

.stat-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

.stat-value {
  display: block;
  margin-top: 4px;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.45;
}

.radar-card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: 10px 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.radar-card svg {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-dim);
}

.legend-line {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 99px;
  margin-right: 6px;
  vertical-align: middle;
}

.legend-line.owner {
  background: var(--accent);
}

.legend-line.ideal {
  background: repeating-linear-gradient(90deg, var(--green) 0 4px, transparent 4px 7px);
}

.radar-note {
  margin: 9px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-dim);
}

.secondary-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.secondary-art {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
}

.secondary-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.secondary-body {
  flex: 1;
  min-width: 0;
}

.sec-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.sec-top h4 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0;
}

.sec-match {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-deep);
}

.secondary-body p {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-dim);
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.result-actions .btn {
  flex: 1;
}

.copy-row {
  text-align: center;
  margin-top: 14px;
}

.text-btn {
  background: none;
  border: 0;
  padding: 6px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-btn:hover {
  color: var(--ink-2);
}

.disclaimer {
  max-width: 46em;
  margin: 24px auto 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.75;
  color: var(--ink-dim);
}

/* ---------- 弹窗与提示 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 23, 16, 0.58);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  max-height: 92dvh;
  overflow: auto;
  background: var(--paper);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(43, 38, 32, 0.08);
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(43, 38, 32, 0.14);
}

.modal-tip {
  margin: 6px 0 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-dim);
}

.modal-card img {
  display: block;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
}

.modal-download {
  width: 100%;
  margin-top: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #FFF8EC;
  font-size: 12.5px;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(43, 38, 32, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 响应式 ---------- */

@media (min-width: 560px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .app {
    padding: 16px 16px 44px;
  }

  .masthead {
    padding-top: 40px;
  }

  .display {
    margin-top: 14px;
  }

  .lede {
    font-size: 15.5px;
  }

  .marquee {
    margin-left: -16px;
    margin-right: -16px;
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) 118px;
    padding: 20px 18px;
    gap: 4px;
  }

  .hero-copy h2 {
    font-size: 30px;
    margin-top: 12px;
  }

  .hero-copy .tagline {
    font-size: 12px;
  }

  .hero-copy .en {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .hero-art {
    max-width: 128px;
  }

  .result-actions {
    flex-direction: column;
  }

  .question-card {
    border-radius: 24px;
  }
}

@media (max-width: 360px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-art {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .marquee-track {
    animation: none;
  }
}

/* ---------- 动画 ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes optionIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
