:root {
  --bg: #ebe3d4;
  --bg-deep: #ddd0bb;
  --surface: rgba(251, 247, 240, 0.88);
  --surface-strong: #fffdf9;
  --ink: #1d201d;
  --muted: #5f665f;
  --line: rgba(31, 35, 32, 0.12);
  --accent: #9b4b32;
  --accent-soft: rgba(155, 75, 50, 0.12);
  --accent-deep: #783724;
  --shadow: 0 18px 50px rgba(53, 43, 32, 0.1);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 250, 240, 0.75), transparent 30%),
    radial-gradient(circle at bottom right, rgba(168, 74, 42, 0.12), transparent 35%),
    linear-gradient(135deg, var(--bg), var(--bg-deep));
}

button, input, textarea, select { font: inherit; }
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.brand { font-family: "STSong", "Songti SC", "SimSun", serif; font-size: 1.1rem; letter-spacing: 0.08em; }

.ghost-button, .primary-button, .secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.ghost-button { background: rgba(255, 250, 240, 0.65); color: var(--ink); border: 1px solid var(--line); }
.primary-button { background: var(--accent); color: #fff8f1; box-shadow: 0 12px 24px rgba(126, 53, 28, 0.22); }
.secondary-button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.ghost-button:hover, .primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.view { animation: fade-up 320ms ease; }

.hero, .question-layout, .result-layout, .metric-grid, .path-grid, .signal-list, .people-grid, .detail-grid, .result-chip-grid {
  display: grid;
  gap: 14px;
}
.hero { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 22px; }
.question-layout, .result-layout { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: 22px; }
.metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; }
.result-chip-grid, .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; }
.people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hero-copy, .hero-side, .question-panel, .question-sidebar, .result-main, .result-side { padding: 30px; }
.hero-side { display: flex; flex-direction: column; justify-content: space-between; }
.home-stack {
  display: grid;
  gap: 22px;
}
.hero-home {
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(180deg, rgba(255, 252, 247, 0.88), rgba(248, 242, 233, 0.84));
}
.hero-home-inner {
  width: min(980px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-home h1 {
  margin-top: 0;
  max-width: none;
  font-size: clamp(3.2rem, 6vw, 5.6rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
}
.hero-subtitle {
  width: min(920px, 100%);
  margin: 22px auto 0;
  font-size: clamp(1.08rem, 1.55vw, 1.35rem);
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
}
.hero-lead {
  width: min(560px, 100%);
  max-width: 560px;
  margin: 18px auto 0;
  font-size: 1rem;
  line-height: 1.85;
  text-align: center;
}
.hero-home .hero-actions {
  width: 100%;
  justify-content: center;
  margin-top: 28px;
}
.hero-home .primary-button {
  min-width: 220px;
  min-height: 62px;
  padding: 16px 28px;
  font-size: 1.08rem;
  font-weight: 600;
}
.home-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.home-module {
  padding: 28px;
  background: rgba(251, 247, 240, 0.82);
}
.home-module h2 {
  font-size: 1.5rem;
  margin-top: 4px;
}
.home-module p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}
.compact-path-grid {
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.home-summary { margin-top: 26px; display: grid; gap: 12px; }
.summary-line {
  display: grid;
  gap: 6px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.summary-line strong,
.side-kicker,
.person-label,
.path-focus-meta,
.result-type-name {
  letter-spacing: 0.03em;
}
.side-kicker {
  margin-bottom: 10px;
  color: var(--accent-deep);
  font-size: 0.88rem;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.92rem;
}

h1, h2, h3 { margin: 0; font-family: "STSong", "Songti SC", "SimSun", serif; line-height: 1.2; }
h1 { margin-top: 18px; font-size: clamp(2.3rem, 5vw, 4.4rem); max-width: 10em; }
.lead, .hero-side p, .metric span, .path-card span, .result-chip span, .detail-card span, .hint, .question-meta, .sidebar-note, .inline-note, .signal-item {
  color: var(--muted);
  line-height: 1.8;
}
.lead { font-size: 1.04rem; max-width: 42rem; margin: 20px 0 0; }
.hero-actions, .question-actions, .result-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.path-grid { margin-top: 22px; }
.metric, .path-card, .result-chip, .detail-card, .signal-item, .person-card, .option {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 247, 0.82);
}
.metric, .path-card, .result-chip, .detail-card, .signal-item { padding: 18px; }
.metric strong, .path-card strong, .result-chip strong, .detail-card strong, .person-card strong { display: block; margin-bottom: 6px; font-size: 1rem; }
.compact-metric-grid { margin-top: 24px; }
.path-card-home { background: rgba(255, 250, 244, 0.65); }
.path-card-home {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 16px;
}
.path-card-home strong {
  margin-bottom: 0;
  font-size: 1.02rem;
}
.sample-preview {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.sample-preview-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.muted-preview {
  grid-template-columns: 1fr;
}
.sample-preview-item {
  padding: 10px 12px;
  border: 1px solid rgba(31, 35, 32, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 251, 246, 0.62);
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
}

.progress { margin-bottom: 20px; }
.progress-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.progress-bar { height: 10px; width: 100%; background: rgba(31, 35, 32, 0.08); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #d47d43); transition: width 200ms ease; }
.question-text { margin: 18px 0 0; font-size: clamp(1.5rem, 2vw, 2rem); }
.quiz-single-shell {
  width: min(920px, 100%);
  margin: 0 auto;
}
.question-panel-wide {
  padding: 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 18%),
    rgba(251, 247, 240, 0.92);
}
.options { display: grid; gap: 14px; margin-top: 24px; }
.option {
  text-align: left;
  padding: 20px 22px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  background: rgba(255, 253, 249, 0.92);
}
.option:hover {
  transform: translateY(-1px);
  border-color: rgba(168, 74, 42, 0.28);
  box-shadow: 0 12px 24px rgba(53, 43, 32, 0.06);
}
.option.active {
  background: rgba(155, 75, 50, 0.08);
  border-color: rgba(155, 75, 50, 0.46);
  box-shadow: 0 14px 28px rgba(155, 75, 50, 0.08);
}
.option-key {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(31, 35, 32, 0.08); margin-right: 14px; font-weight: 600;
}
.question-actions {
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 6px;
}

.result-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.result-kicker, .section-title { color: var(--accent-deep); font-weight: 600; }
.result-subtitle { margin-top: 14px; color: var(--muted); line-height: 1.9; max-width: 48rem; }
.result-headline {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.result-type-name {
  margin-top: 14px;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.3;
}
.path-focus-card {
  margin-top: 24px;
  padding: 26px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(155, 75, 50, 0.18);
  background:
    linear-gradient(180deg, rgba(155, 75, 50, 0.07), rgba(255, 252, 247, 0.94)),
    rgba(255, 252, 247, 0.94);
}
.compact-focus-card {
  margin-top: 18px;
  padding: 20px 22px;
}
.path-focus-meta,
.person-label {
  color: var(--accent-deep);
  font-size: 0.84rem;
  text-transform: uppercase;
}
.path-focus-name {
  margin-top: 8px;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  font-size: 1.7rem;
}
.result-judgement {
  margin: 18px 0 0;
  max-width: 44rem;
  color: var(--ink);
  line-height: 1.8;
  font-size: 1.02rem;
}
.path-focus-card p {
  margin: 16px 0 10px;
  line-height: 1.85;
}
.path-focus-card span {
  color: var(--muted);
  line-height: 1.75;
}
.single-line-chip {
  grid-template-columns: 1fr;
  margin-top: 16px;
}
.compact-chip {
  background: rgba(255, 251, 246, 0.7);
}
.detail-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.brief-card {
  background: rgba(255, 252, 247, 0.72);
}
.emphasis-card {
  background: rgba(255, 250, 244, 0.92);
}
.person-card {
  padding: 22px 20px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: linear-gradient(180deg, rgba(155, 75, 50, 0.06), transparent), rgba(255, 252, 247, 0.9);
}
.person-card-top {
  margin-bottom: 16px;
}
.person-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.95rem;
}
.person-story {
  display: grid;
  gap: 14px;
}
.person-story p span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-deep);
  font-size: 0.83rem;
  letter-spacing: 0.02em;
}
.sidebar-block + .sidebar-block { margin-top: 22px; }
.subtle-panel {
  background: rgba(255, 252, 247, 0.58);
}
.result-side {
  background: rgba(250, 246, 239, 0.65);
}
.result-side .signal-item {
  background: rgba(255, 252, 247, 0.55);
  font-size: 0.95rem;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .hero, .question-layout, .result-layout, .detail-grid, .result-chip-grid, .people-grid, .home-module-grid, .muted-preview { grid-template-columns: 1fr; }
  .hero-home {
    min-height: auto;
    padding: 28px;
  }
  .hero-subtitle {
    width: min(920px, 100%);
  }
}

@media (max-width: 640px) {
  .page-shell { width: min(100% - 20px, 1180px); padding-top: 16px; }
  .hero-copy, .hero-side, .question-panel, .question-sidebar, .result-main, .result-side { padding: 22px; }
  h1 { font-size: 2.4rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .question-actions, .hero-actions, .result-actions { flex-direction: column; }
  .question-actions button, .hero-actions button, .result-actions button { width: 100%; }
  .question-panel-wide { padding: 24px; }
  .hero-home {
    padding: 22px;
  }
  .home-module,
  .hero-home {
    padding: 22px;
  }
  .hero-home .primary-button {
    width: 100%;
    min-width: 0;
  }
  .compact-path-grid {
    grid-template-columns: 1fr;
  }
  .hero-home h1 {
    font-size: 2.9rem;
  }
  .hero-subtitle {
    font-size: 1.22rem;
    line-height: 1.55;
    white-space: normal;
  }
  .home-module {
    padding: 22px;
  }
}
