:root {
  color-scheme: light;
  --ink: #1b1c1c;
  --ink-soft: #58413e;
  --paper: #fbf9f8;
  --paper-strong: #ffffff;
  --paper-muted: #efeded;
  --cinnabar: #80150b;
  --cinnabar-deep: #410100;
  --moss: #625e52;
  --moss-deep: #1e1c12;
  --gold: #a66f32;
  --line: #e0bfba;
  --line-soft: rgba(140, 113, 108, 0.24);
  --shadow: none;
  --radius: 4px;
  --radius-lg: 8px;
  --home-max: 640px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  font-family:
    "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at 82% 4%, rgba(27, 28, 28, 0.035), transparent 32rem),
    linear-gradient(90deg, rgba(128, 21, 11, 0.018) 1px, transparent 1px),
    linear-gradient(rgba(128, 21, 11, 0.014) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 38px 38px, 38px 38px, auto;
  -webkit-tap-highlight-color: rgba(128, 21, 11, 0.12);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

.page-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  margin: 0 auto;
  padding:
    max(6px, env(safe-area-inset-top))
    clamp(16px, 4vw, 28px)
    6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(224, 191, 186, 0.42);
  background: rgba(251, 249, 248, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand-button,
.nav-links button {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.36);
  color: var(--ink);
}

.brand-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-color: transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--cinnabar);
  font-weight: 700;
}

.brand-seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--cinnabar);
  color: #fff8f4;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links button {
  min-height: 44px;
  padding: 7px 15px;
  border-radius: 999px;
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
}

#app {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  flex: 1;
  outline: none;
}

body[data-view="home"] #app {
  width: 100%;
}

.hero {
  min-height: calc(100svh - 58px);
  width: calc(100vw - 28px);
  max-width: var(--home-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(18px, 3.2vw, 28px);
  padding: clamp(18px, 4vw, 38px) 0 max(18px, env(safe-area-inset-bottom));
}

.hero-main {
  position: relative;
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.eyebrow {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 8.2vw, 3rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 36rem;
  margin: 0;
  color: var(--moss);
  font-size: clamp(1.2rem, 4.4vw, 1.75rem);
  font-style: italic;
  font-weight: 600;
  line-height: 1.35;
}

.hero-copy {
  max-width: 100%;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 2.6vw, 1.08rem);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.hero-points {
  width: fit-content;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--cinnabar);
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
  font-size: clamp(0.76rem, 2.4vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-points span {
  white-space: nowrap;
}

.hero-points i {
  color: rgba(88, 65, 62, 0.52);
  font-style: normal;
}

.hero-start {
  width: 100%;
  min-height: 54px;
  padding-inline: 24px;
  font-size: clamp(1.08rem, 3vw, 1.22rem);
  font-weight: 700;
}

.hero-footnote {
  display: grid;
  gap: 3px;
  max-width: 100%;
  overflow-x: auto;
  color: rgba(64, 64, 64, 0.66);
  text-align: center;
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
  scrollbar-width: none;
}

.hero-footnote::-webkit-scrollbar {
  display: none;
}

.hero-footnote p {
  margin: 0;
  min-width: max-content;
  white-space: nowrap;
}

.hero-visual {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px;
  border: 1px solid rgba(224, 191, 186, 0.55);
  border-radius: var(--radius-lg);
  background: rgba(245, 243, 243, 0.72);
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 21 / 9;
  display: block;
  object-fit: cover;
  object-position: 52% 43%;
  border-radius: var(--radius);
  filter: grayscale(0.18) sepia(0.16) saturate(0.8);
  opacity: 0.95;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: var(--radius);
  background: linear-gradient(0deg, rgba(251, 249, 248, 0.22), transparent 58%);
  pointer-events: none;
}

.hero-copy-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 92px;
  display: grid;
  align-items: center;
  padding: 14px 58px 14px 14px;
  border-left: 2px solid var(--cinnabar);
  background: rgba(255, 255, 255, 0.44);
}

.hero-copy-card .hero-card-seal {
  position: absolute;
  right: 16px;
  bottom: -12px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  margin: 0;
  border: 2px solid rgba(128, 21, 11, 0.34);
  border-radius: var(--radius);
  background: transparent;
  color: rgba(128, 21, 11, 0.34);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  transform: rotate(-10deg);
}

.hero-result-card {
  position: relative;
  overflow: hidden;
  display: none;
  min-height: 0;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

.hero-result-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(224, 191, 186, 0.36);
  border-radius: var(--radius);
  pointer-events: none;
}

.hero-result-card::after {
  content: "";
  display: none;
}

.hero-card-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(88, 65, 62, 0.72);
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-card-kicker {
  position: relative;
  z-index: 1;
  margin: 20px 0 8px;
  color: var(--ink-soft);
  font-weight: 700;
}

.hero-result-card h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  line-height: 1.18;
}

.hero-result-card p:not(.hero-card-kicker) {
  position: relative;
  z-index: 1;
  max-width: 17rem;
  margin: 14px 0 0;
  color: var(--ink-soft);
}

.hero-card-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.hero-card-metrics span {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(245, 243, 243, 0.7);
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.hero-card-metrics strong {
  display: block;
  color: var(--cinnabar);
  font-size: 1.35rem;
  line-height: 1.05;
}

.hero-actions,
.result-actions,
.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero .hero-actions {
  width: 100%;
  margin-top: 0;
}

.hero .hero-actions .primary-button {
  width: 100%;
}

.primary-button,
.secondary-button,
.quiet-button,
.option-button {
  min-height: 48px;
  border-radius: var(--radius);
  transition:
    transform 160ms ease,
    background 180ms ease;
}

.primary-button,
.secondary-button,
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
}

.primary-button {
  border: 1px solid var(--cinnabar-deep);
  background: var(--cinnabar);
  color: #fff8f4;
  box-shadow: none;
  font-weight: 700;
}

.secondary-button {
  border: 1px solid rgba(64, 64, 64, 0.42);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.quiet-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
}

.primary-button:hover,
.secondary-button:hover,
.quiet-button:hover,
.option-button:hover {
  transform: none;
}

.primary-button:hover {
  background: #6f1209;
}

.secondary-button:hover,
.quiet-button:hover {
  background: rgba(245, 243, 243, 0.78);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.quiet-button:focus-visible,
.option-button:focus-visible,
.nav-links button:focus-visible,
.brand-button:focus-visible {
  outline: 3px solid rgba(158, 47, 34, 0.35);
  outline-offset: 3px;
}

.quiz-panel,
.result-panel,
.plain-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(239, 237, 237, 0.78)),
    var(--paper);
  box-shadow: var(--shadow);
}

.plain-panel h1 {
  margin: 0;
  font-size: 1.3rem;
}

.similar-item strong {
  display: block;
  line-height: 1.3;
}

.similar-item span,
.muted {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.quiz-hint {
  white-space: nowrap;
}

.quiz-wrap {
  min-height: calc(100svh - 78px);
  display: grid;
  align-items: center;
  padding: clamp(20px, 4vw, 42px) 0;
}

.quiz-panel {
  position: relative;
  overflow: hidden;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 34px) clamp(20px, 4vw, 30px);
  border-color: rgba(58, 46, 44, 0.1);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(to bottom, rgba(128, 21, 11, 0.08), rgba(251, 249, 248, 0)),
    var(--paper);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  color: rgba(58, 46, 44, 0.64);
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.progress-track {
  height: 6px;
  margin: 12px 0 24px;
  overflow: hidden;
  border-radius: 0;
  background: rgba(58, 46, 44, 0.08);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cinnabar), var(--gold));
  transition: width 220ms ease;
}

.question-title {
  margin: 0;
  color: #3a2e2c;
  font-size: clamp(1.55rem, 3.2vw, 2.28rem);
  font-weight: 900;
  line-height: 1.18;
}

.option-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.option-button {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid rgba(58, 46, 44, 0.08);
  background: rgba(255, 255, 255, 0.58);
  color: #3a2e2c;
  text-align: left;
  line-height: 1.42;
  user-select: none;
  -webkit-user-select: none;
}

.option-button:active,
.primary-button:active,
.secondary-button:active,
.quiet-button:active,
.nav-links button:active,
.brand-button:active {
  transform: translateY(0) scale(0.99);
}

.option-button[aria-pressed="true"] {
  border-color: rgba(158, 47, 34, 0.7);
  background: rgba(158, 47, 34, 0.08);
  box-shadow: inset 0 0 0 1px rgba(158, 47, 34, 0.08);
}

.option-letter {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--paper-muted);
  color: var(--cinnabar);
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
  font-weight: 900;
}

.option-button[aria-pressed="true"] .option-letter {
  background: var(--cinnabar);
  color: #fff8f4;
}

.quiz-actions {
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(58, 46, 44, 0.08);
}

.quiz-actions .secondary-button {
  min-height: 42px;
  padding: 8px 16px;
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}

.quiz-actions .secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.quiz-hint {
  color: rgba(58, 46, 44, 0.58);
  font-size: 0.86rem;
}

.quiz-ad-card {
  margin-top: 12px;
}

.csj-ad-slot {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed rgba(58, 46, 44, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(128, 21, 11, 0.045), rgba(255, 255, 255, 0.44)),
    rgba(255, 255, 255, 0.46);
  color: rgba(58, 46, 44, 0.58);
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
}

.ad-label {
  min-width: 38px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(128, 21, 11, 0.28);
  border-radius: var(--radius);
  color: var(--cinnabar);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ad-state {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
}

.result-wrap,
.plain-wrap {
  padding: clamp(28px, 5vw, 62px) 0;
}

.result-panel,
.plain-panel {
  padding: clamp(20px, 4vw, 42px);
}

.result-title {
  margin: 0;
  color: #3a2e2c;
  font-size: clamp(2.45rem, 8vw, 3.25rem);
  font-weight: 900;
  line-height: 0.98;
}

.result-summary-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  padding: clamp(24px, 5vw, 34px) clamp(20px, 5vw, 28px) 8px;
  border-radius: 0;
  color: #3a2e2c;
  background:
    linear-gradient(to bottom, rgba(128, 21, 11, 0.08), rgba(251, 249, 248, 0)),
    var(--paper);
}

.result-summary-card::after {
  content: "";
  display: none;
}

.result-summary-card > * {
  position: relative;
  z-index: 1;
}

.result-card-kicker {
  margin: 0 0 4px;
  color: var(--cinnabar);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.result-summary-card .result-title {
  color: #3a2e2c;
}

.result-summary-card .result-ref {
  margin-top: 9px;
  color: rgba(58, 46, 44, 0.62);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.4;
}

.result-summary-card .tag {
  border-color: rgba(58, 46, 44, 0.3);
  background: transparent;
  color: #3a2e2c;
  font-size: 0.78rem;
  font-weight: 400;
}

.result-summary-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(138px, 0.9fr);
  gap: 16px;
  align-items: center;
  justify-content: stretch;
  overflow: visible;
}

.match-badge {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: auto;
  min-height: 88px;
  border: 1px solid rgba(58, 46, 44, 0.1);
  border-radius: var(--radius);
  background: var(--paper-muted);
  box-shadow: none;
  justify-self: stretch;
  text-align: center;
  color: rgba(58, 46, 44, 0.62);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.match-badge strong {
  display: block;
  color: var(--cinnabar);
  font-size: clamp(2rem, 8vw, 2.65rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.radar-chart {
  width: min(148px, 100%);
  height: auto;
  display: block;
  justify-self: center;
  color: #3a2e2c;
  transform: translateY(-4px) scale(1.18);
  transform-origin: center;
}

.radar-ring,
.radar-axis {
  fill: none;
  stroke: rgba(58, 46, 44, 0.2);
  stroke-width: 0.9;
}

.radar-area {
  fill: rgba(128, 21, 11, 0.16);
  stroke: var(--cinnabar);
  stroke-width: 1.6;
}

.radar-point {
  fill: var(--paper);
  stroke: var(--cinnabar);
  stroke-width: 0.6;
}

.radar-hit-area {
  fill: transparent;
  cursor: help;
}

.radar-hotspot {
  outline: none;
}

.radar-hotspot:focus .radar-point,
.radar-hotspot:hover .radar-point {
  fill: #ffdad4;
  stroke: var(--cinnabar);
  stroke-width: 1.2;
}

.radar-label {
  fill: rgba(58, 46, 44, 0.78);
  font-size: 7px;
  font-weight: 700;
  cursor: help;
}

.radar-tooltip {
  position: fixed;
  z-index: 40;
  width: min(260px, calc(100% - 28px));
  padding: 9px 11px;
  border: 1px solid rgba(255, 229, 188, 0.32);
  border-radius: var(--radius);
  background: rgba(33, 25, 20, 0.9);
  color: #fff6df;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  font-size: 0.88rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.radar-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 0;
}

.tag {
  padding: 3px 10px;
  border: 1px solid rgba(58, 46, 44, 0.25);
  border-radius: 999px;
  background: transparent;
  color: #3a2e2c;
  font-size: 0.82rem;
  font-weight: 700;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.48fr);
  gap: 28px;
  margin-top: 34px;
}

.analysis-stack {
  display: grid;
  gap: 16px;
}

.analysis-title {
  color: var(--cinnabar-deep);
  font-size: 1.08rem;
  font-weight: 900;
}

.analysis-block {
  padding: 18px;
  border-left: 3px solid rgba(158, 47, 34, 0.5);
  background: rgba(255, 250, 238, 0.54);
}

.analysis-block h3,
.side-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.analysis-block p,
.plain-panel p,
.plain-panel li {
  margin: 0;
  color: var(--ink-soft);
}

.side-stack {
  display: grid;
  gap: 16px;
}

.side-card {
  padding: 18px;
  border: 1px solid rgba(80, 53, 34, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 250, 238, 0.58);
}

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

.similar-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(80, 53, 34, 0.12);
}

.similar-item:last-child {
  border-bottom: 0;
}

.toast {
  min-height: 24px;
  margin-top: 10px;
  color: var(--cinnabar-deep);
  font-weight: 700;
}

.wechat-share-note {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(158, 47, 34, 0.18);
  border-radius: var(--radius);
  background: rgba(158, 47, 34, 0.08);
  color: var(--cinnabar-deep);
  font-size: 0.94rem;
  font-weight: 700;
}

.plain-panel {
  max-width: 840px;
  margin: 0 auto;
}

.plain-panel h2 {
  margin: 28px 0 8px;
  font-size: 1.2rem;
}

.plain-panel ul {
  padding-left: 1.3rem;
}

.site-footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: rgba(33, 25, 20, 0.68);
  font-size: 0.9rem;
}

.site-footer:empty {
  display: none;
}

[hidden] {
  display: none !important;
}

@media (min-width: 760px) {
  .hero-result-card {
    display: block;
  }
}

@media (max-width: 820px) {
  body {
    background:
      radial-gradient(circle at 82% 4%, rgba(27, 28, 28, 0.035), transparent 32rem),
      linear-gradient(90deg, rgba(128, 21, 11, 0.018) 1px, transparent 1px),
      linear-gradient(rgba(128, 21, 11, 0.014) 1px, transparent 1px),
      var(--paper);
    background-size: auto, 38px 38px, 38px 38px, auto;
  }

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

  .hero {
    align-items: stretch;
    min-height: auto;
    padding-top: clamp(26px, 8vw, 42px);
  }

  .match-badge {
    justify-self: start;
    width: 124px;
    height: 124px;
  }

  .quiz-wrap {
    min-height: auto;
    align-items: start;
    padding-top: 26px;
  }

  .quiz-panel,
  .result-panel,
  .plain-panel {
    box-shadow: var(--shadow);
  }

  .result-summary-card {
    grid-template-columns: 1fr;
  }

  .result-summary-metrics {
    justify-content: start;
  }
}

@media (max-width: 560px) {
  #app,
  .site-footer {
    width: min(var(--max), calc(100% - 22px));
  }

  body[data-view="home"] #app {
    width: 100%;
  }

  .topbar {
    width: 100%;
    align-items: center;
    padding:
      max(6px, env(safe-area-inset-top))
      12px
      6px;
    margin-top: 0;
  }

  .brand-button {
    min-width: 0;
  }

  .brand-button span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-links button {
    padding-inline: 10px;
  }

  .hero {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    align-items: center;
    gap: 18px;
    min-height: calc(100svh - 58px);
    padding-top: 18px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .hero > * {
    width: calc(100vw - 56px);
    max-width: 100%;
  }

  .hero .hero-actions {
    width: calc(100vw - 56px);
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(2rem, 8.8vw, 2.55rem);
  }

  .hero-subtitle {
    margin-top: 0;
    font-size: clamp(1.08rem, 5vw, 1.32rem);
  }

  .hero-copy {
    font-size: 0.98rem;
  }

  .hero-points {
    gap: 6px;
  }

  .hero-points span {
    padding: 0;
    font-size: 0.82rem;
  }

  .hero-start {
    min-height: 52px;
    width: 100%;
  }

  .hero-footnote {
    font-size: 0.76rem;
    text-align: center;
  }

  .hero-card-topline {
    font-size: 0.76rem;
  }

  .hero-card-seal {
    width: 44px;
    height: 44px;
    margin-top: 24px;
    border-radius: 8px;
    font-size: 1.48rem;
  }

  .hero-card-kicker {
    margin-top: 18px;
    margin-bottom: 6px;
    font-size: 0.86rem;
  }

  .hero-result-card h2 {
    font-size: 2rem;
  }

  .hero-result-card p:not(.hero-card-kicker) {
    margin-top: 9px;
    font-size: 0.9rem;
  }

  .hero-card-metrics {
    margin-top: 18px;
  }

  .hero-card-metrics span {
    padding: 8px 6px;
    font-size: 0.76rem;
  }

  .hero-card-metrics strong {
    font-size: 1.12rem;
  }

  .hero-actions,
  .result-actions,
  .quiz-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-actions .muted {
    text-align: center;
  }

  .quiz-hint {
    font-size: 0.86rem;
  }

  .quiz-wrap {
    min-height: calc(100svh - 58px);
    align-items: start;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  }

  .quiz-panel {
    padding: 18px 16px 14px;
    border-radius: var(--radius-lg);
  }

  .progress-row {
    font-size: 0.74rem;
  }

  .progress-track {
    height: 5px;
    margin: 10px 0 18px;
  }

  .question-title {
    font-size: clamp(1.38rem, 6vw, 1.78rem);
    line-height: 1.2;
  }

  .option-list {
    gap: 8px;
    margin-top: 16px;
  }

  .option-button {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    min-height: 54px;
    padding: 9px 10px;
    font-size: 0.9rem;
    line-height: 1.34;
  }

  .option-letter {
    width: 30px;
    height: 30px;
  }

  .quiz-actions {
    display: grid;
    grid-template-columns: minmax(84px, auto) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
  }

  .quiz-actions .secondary-button {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .quiz-actions .muted {
    text-align: right;
  }

  .quiz-ad-card {
    margin-top: 8px;
  }

  .csj-ad-slot {
    min-height: 52px;
    padding: 8px 10px;
  }

  .ad-label {
    min-width: 34px;
    min-height: 22px;
    font-size: 0.66rem;
  }

  .ad-state {
    font-size: 0.74rem;
  }

  .result-wrap,
  .plain-wrap {
    padding-top: 14px;
  }

  .result-panel,
  .plain-panel {
    padding: 18px 14px;
  }

  .result-title {
    font-size: clamp(1.74rem, 9vw, 2.55rem);
    line-height: 1.08;
  }

  .result-summary-card {
    padding: 16px;
    gap: 14px;
  }

  .result-summary-card::after {
    right: 12px;
    bottom: 12px;
    width: 54px;
    height: 54px;
  }

  .result-card-kicker {
    margin-bottom: 8px;
    font-size: 0.92rem;
  }

  .result-ref {
    margin-top: 10px;
    font-size: 0.96rem;
  }

  .tag-row {
    gap: 6px;
    margin-top: 12px;
  }

  .tag {
    padding: 4px 8px;
    font-size: 0.84rem;
  }

  .match-badge {
    width: 100%;
    height: auto;
    min-height: 92px;
    padding: 8px 12px;
    border-radius: var(--radius);
    justify-self: start;
  }

  .match-badge strong {
    display: block;
    margin-right: 0;
    font-size: 1.72rem;
  }

  .result-summary-metrics {
    width: 100%;
    grid-template-columns: minmax(92px, 0.78fr) minmax(136px, 1fr);
    gap: 10px;
  }

  .radar-chart {
    width: min(144px, 100%);
    height: auto;
    justify-self: end;
    transform: translateY(-4px) scale(1.17);
  }

  .result-grid {
    gap: 18px;
    margin-top: 22px;
  }

  .analysis-stack,
  .side-stack {
    gap: 12px;
  }

  .analysis-block,
  .side-card {
    padding: 14px;
  }

  .analysis-block h3,
  .side-card h3 {
    margin-bottom: 6px;
  }

  .similar-item {
    align-items: flex-start;
    padding: 8px 0;
  }

  .site-footer {
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 360px) {
  .brand-button {
    max-width: 178px;
  }

  .nav-links {
    gap: 6px;
  }

  .nav-links button {
    padding-inline: 8px;
  }

}

body[data-view="result"] .topbar,
body[data-view="result"] .site-footer {
  display: none;
}

body[data-view="result"] #app {
  width: 100vw;
  max-width: 500px;
}

body[data-view="result"] .result-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 0;
}

body[data-view="result"] .result-panel {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(251, 249, 248, 0.97), rgba(251, 249, 248, 0.97)),
    var(--paper);
  box-shadow: none;
}

.result-poster-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 clamp(20px, 5vw, 28px) 16px;
  overflow: hidden;
}

.poster-block {
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid rgba(58, 46, 44, 0.06);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.poster-block-wide {
  grid-column: 1 / -1;
  min-height: 0;
  border-left: 2px solid rgba(128, 21, 11, 0.52);
  background: rgba(245, 243, 243, 0.5);
}

.poster-block h3 {
  margin: 0 0 4px;
  color: var(--cinnabar);
  font-size: 0.78rem;
  font-weight: 900;
}

.poster-block p {
  margin: 0;
  color: rgba(58, 46, 44, 0.72);
  font-size: 0.72rem;
  line-height: 1.42;
}

.poster-block-similar {
  grid-column: 1 / -1;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-width: 1px 0 0;
  border-radius: 0;
  background: transparent;
}

.poster-block-similar h3 {
  flex: 0 0 auto;
  margin: 0;
  color: rgba(58, 46, 44, 0.82);
  font-size: 0.7rem;
}

.poster-block-similar p {
  flex: 1 1 auto;
  text-align: right;
  font-size: 0.7rem;
}

body[data-view="result"] .result-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 18px clamp(20px, 5vw, 28px);
  border-top: 1px solid rgba(58, 46, 44, 0.06);
  background: var(--paper);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

body[data-view="result"] .result-actions .primary-button,
body[data-view="result"] .result-actions .secondary-button {
  min-height: 48px;
  padding: 11px 12px;
  font-family: "Source Sans 3", "PingFang SC", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

body[data-view="result"] .wechat-share-note {
  margin: 0 clamp(20px, 5vw, 28px) 10px;
  padding: 8px 10px;
  border-color: rgba(128, 21, 11, 0.16);
  background: rgba(128, 21, 11, 0.06);
  color: var(--cinnabar);
  font-size: 0.76rem;
}

body[data-view="result"] .toast {
  min-height: 0;
  margin: 0;
  padding: 0 clamp(20px, 5vw, 28px) 8px;
  color: var(--cinnabar);
  font-size: 0.76rem;
  text-align: center;
}

@media (min-width: 561px) {
  body[data-view="result"] {
    background: var(--paper-muted);
  }

  body[data-view="result"] .result-wrap {
    padding: 16px 0;
  }

  body[data-view="result"] .result-panel {
    min-height: min(884px, calc(100svh - 32px));
    border: 1px solid rgba(58, 46, 44, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 560px) {
  body[data-view="result"] {
    background:
      linear-gradient(rgba(251, 249, 248, 0.97), rgba(251, 249, 248, 0.97)),
      var(--paper);
  }

  body[data-view="result"] #app {
    width: 100%;
  }

  body[data-view="result"] .result-wrap {
    padding: 0;
  }

  body[data-view="result"] .result-panel {
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow-y: hidden;
    padding: 0;
  }

  body[data-view="result"] .result-summary-card {
    flex: 0 0 auto;
    padding: 18px 22px 6px;
    gap: 8px;
  }

  body[data-view="result"] .result-card-kicker {
    margin-bottom: 4px;
    font-size: 0.78rem;
  }

  body[data-view="result"] .result-title {
    font-size: clamp(2rem, 10vw, 2.78rem);
  }

  body[data-view="result"] .result-ref {
    margin-top: 6px;
    font-size: 0.68rem;
  }

  body[data-view="result"] .tag-row {
    gap: 5px;
    margin-top: 7px;
  }

  body[data-view="result"] .tag {
    padding: 2px 8px;
    font-size: 0.68rem;
  }

  body[data-view="result"] .result-summary-metrics {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.86fr);
    gap: 10px;
  }

  body[data-view="result"] .match-badge {
    min-height: 72px;
    padding: 6px 8px;
    font-size: 0.64rem;
  }

  body[data-view="result"] .match-badge strong {
    font-size: 1.86rem;
  }

  body[data-view="result"] .radar-chart {
    width: min(112px, 100%);
    transform: translate(-8px, -8px) scale(1.39);
  }

  .result-poster-grid {
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: min-content;
    align-content: start;
    gap: 6px;
    padding: 0 22px 8px;
  }

  .poster-block {
    align-self: start;
    padding: 7px 10px;
  }

  .poster-block-wide {
    grid-column: 1 / -1;
  }

  .poster-block h3 {
    margin-bottom: 2px;
    font-size: 0.7rem;
  }

  .poster-block p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    font-size: 0.64rem;
    line-height: 1.28;
  }

  .poster-block-similar p {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="result"] .wechat-share-note {
    margin: 0 24px 8px;
    padding: 7px 8px;
    font-size: 0.7rem;
  }

  body[data-view="result"] .result-actions {
    gap: 0;
    margin: 0;
    padding: 8px 22px max(8px, env(safe-area-inset-bottom));
  }

  body[data-view="result"] .result-actions .primary-button,
  body[data-view="result"] .result-actions .secondary-button {
    min-height: 40px;
    padding: 8px;
    font-size: 0.8rem;
  }

  body[data-view="result"] .toast {
    padding: 0 22px 4px;
    font-size: 0.72rem;
  }
}

@media (max-width: 560px) and (min-height: 740px) {
  .poster-block p {
    -webkit-line-clamp: 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
