:root {
  --bg: #fbf4e8;
  --bg-deep: #f3e0c4;
  --surface: rgba(255, 252, 246, 0.92);
  --surface-strong: #fff9f1;
  --line: rgba(98, 66, 36, 0.12);
  --text: #312014;
  --muted: #746253;
  --accent: #ff8d47;
  --accent-strong: #ff6b4a;
  --green: #6f9155;
  --gold: #f4c15f;
  --shadow: 0 24px 60px rgba(116, 79, 35, 0.14);
  --shadow-soft: 0 14px 32px rgba(116, 79, 35, 0.1);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 141, 71, 0.18), transparent 22%),
    radial-gradient(circle at 100% 0%, rgba(111, 145, 85, 0.16), transparent 24%),
    radial-gradient(circle at 100% 100%, rgba(244, 193, 95, 0.18), transparent 28%),
    linear-gradient(180deg, #fff8ef 0%, var(--bg) 52%, #f6ead5 100%);
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1160px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 54px;
}

.topbar,
.top-actions,
.hero-pills,
.hero-actions,
.hero-notes,
.hero-result-list,
.stat-grid,
.feature-grid,
.fruit-grid,
.detail-grid,
.question-actions,
.result-actions,
.result-meta,
.result-links,
.chip-row,
.directory-grid,
.cta-bar,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffd27b, #ff8d47);
  color: #fff;
  font-size: 22px;
  box-shadow: var(--shadow-soft);
}

.brand-copy strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.pill-link,
.ghost-link,
.tiny-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pill-link:hover,
.ghost-link:hover,
.cta-button:hover,
.choice-card:hover,
.fruit-card:hover,
.directory-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.pill-link.primary,
.cta-button.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 18px 36px rgba(255, 107, 74, 0.24);
}

.hero,
.panel,
.fruit-card,
.directory-card,
.choice-card,
.result-card,
.poster-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 280px;
  height: 280px;
  right: -80px;
  top: -100px;
  background: radial-gradient(circle, rgba(255, 141, 71, 0.26), rgba(255, 141, 71, 0));
}

.hero::after {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(111, 145, 85, 0.2), rgba(111, 145, 85, 0));
}

.hero-grid,
.feature-grid,
.detail-grid,
.result-layout,
.all-layout {
  display: grid;
  gap: 20px;
}

.hero-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
}

.hero-copy {
  display: grid;
  align-content: center;
  order: 1;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 141, 71, 0.12);
  color: #c55a2d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.hero h1,
.page-title {
  margin: 16px 0 10px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.hero-lead,
.section-copy,
.meta-copy,
.footer-copy,
.faq-item p,
.empty-state p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.82;
}

.hero-actions,
.hero-notes {
  margin-top: 20px;
}

.hero-actions .cta-button.primary {
  min-height: 56px;
  padding: 14px 24px;
  font-size: 16px;
}

.hero-result-list {
  margin-top: 22px;
}

.hero-result-item,
.sample-result-card,
.deliverable-card {
  border: 1px solid rgba(98, 66, 36, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.hero-result-item {
  flex: 1 1 220px;
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 18px;
}

.hero-result-item strong,
.deliverable-card strong,
.sample-result-copy strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.hero-result-item span,
.deliverable-card span,
.sample-result-copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.hero-visual {
  position: relative;
  display: block;
  padding: 20px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 235, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  order: 2;
}

.hero-visual-link {
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-visual-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.hero-visual img {
  width: 100%;
  border-radius: 24px;
}

.hero-visual .visual-caption {
  position: absolute;
  left: 18px;
  top: 18px;
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(98, 66, 36, 0.08);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

.hero-visual .visual-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(98, 66, 36, 0.1);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  color: var(--muted);
}

.panel {
  margin-top: 18px;
  padding: 24px;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}

.stat-grid {
  margin-top: 18px;
}

.stat-card {
  flex: 1 1 180px;
  min-width: 160px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(98, 66, 36, 0.08);
}

.stat-card strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.stat-card span,
.meta-label,
.tiny-copy {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.trust-panel {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  align-items: start;
}

.trust-copy {
  display: grid;
  gap: 10px;
}

.trust-list {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.trust-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(98, 66, 36, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.trust-item strong {
  display: block;
  font-size: 16px;
  margin-bottom: 5px;
}

.trust-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.deliverable-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.feature-card,
.faq-item,
.deliverable-card,
.sample-result-card {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(98, 66, 36, 0.08);
}

.feature-card h3,
.faq-item h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.feature-card p,
.faq-item p {
  margin: 0;
}

.fruit-grid,
.directory-grid {
  margin-top: 18px;
}

.fruit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fruit-card,
.directory-card {
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.fruit-card {
  padding: 18px;
}

.fruit-card img,
.directory-card img,
.result-visual img,
.detail-hero img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,247,234,0.9));
}

.fruit-card h3,
.directory-card h3,
.result-hero h1,
.detail-copy h1 {
  margin: 14px 0 8px;
  letter-spacing: -0.04em;
}

.fruit-card p,
.directory-card p,
.detail-copy p,
.result-summary,
.trait-row span,
.sample-result-copy p {
  color: var(--muted);
  line-height: 1.75;
}

.sample-result-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.sample-result-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,247,234,0.9));
}

.sample-result-copy h3 {
  margin: 0 0 6px;
  font-size: 28px;
}

.sample-result-copy .result-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: rgba(255, 141, 71, 0.12);
  color: #c55a2d;
  font-size: 13px;
  font-weight: 800;
}

.sample-result-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.sample-result-metrics span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(98, 66, 36, 0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.detail-grid,
.result-layout,
.all-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: start;
}

.detail-hero,
.result-card,
.poster-card {
  padding: 24px;
}

.detail-hero {
  display: grid;
  gap: 18px;
}

.detail-copy h1,
.result-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
}

.chip-row {
  margin: 14px 0 0;
}

.tiny-chip {
  padding: 8px 12px;
  background: rgba(255, 141, 71, 0.1);
  color: #c55a2d;
}

.qa-grid {
  display: grid;
  gap: 14px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.question-progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(98, 66, 36, 0.08);
  overflow: hidden;
  margin-top: 14px;
}

.question-progress span,
.trait-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--gold));
}

.choice-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.choice-card {
  width: 100%;
  padding: 18px;
  text-align: left;
  cursor: pointer;
}

.choice-card.is-selected {
  border-color: rgba(255, 107, 74, 0.42);
  background: rgba(255, 244, 236, 0.95);
  box-shadow: 0 14px 28px rgba(255, 107, 74, 0.16);
}

.choice-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.choice-card span {
  color: var(--muted);
  line-height: 1.75;
}

.cta-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  cursor: pointer;
  background: rgba(255,255,255,0.82);
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.secondary-button {
  color: var(--muted);
}

.secondary-button:disabled,
.cta-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.result-meta {
  margin: 14px 0;
}

.result-badge {
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 141, 71, 0.12);
  color: #c55a2d;
  font-size: 13px;
  font-weight: 800;
}

.trait-list {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.result-subpanel {
  margin-top: 18px;
}

#friendViewHint.friend-status-waiting {
  color: #a4572d;
}

#friendViewHint.friend-status-ready {
  color: #4f7a33;
}

.friend-view-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(98, 66, 36, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.friend-view-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.friend-view-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.friend-view-card.unlocked {
  background: linear-gradient(180deg, rgba(255, 249, 240, 0.96), rgba(255, 255, 255, 0.82));
  border-color: rgba(255, 141, 71, 0.18);
}

.trait-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
}

.trait-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(98, 66, 36, 0.08);
  overflow: hidden;
}

.poster-frame {
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,246,229,0.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.poster-frame canvas,
.poster-frame img {
  width: 100%;
  border-radius: 22px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.directory-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.stats-mini-grid {
  display: grid;
  gap: 12px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.trend-card {
  padding: 16px 14px;
  border-radius: 24px;
  border: 1px solid rgba(98, 66, 36, 0.08);
  background: rgba(255, 255, 255, 0.72);
  min-height: 220px;
  display: grid;
  align-content: end;
  gap: 10px;
}

.trend-bars {
  height: 120px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.trend-bar {
  width: 100%;
  min-height: 8px;
  border-radius: 999px 999px 14px 14px;
}

.trend-bar.result,
.trend-chip.result {
  background: linear-gradient(180deg, #ffb05d, #ff8d47);
}

.trend-bar.unlock,
.trend-chip.unlock {
  background: linear-gradient(180deg, #ffd36d, #f4c15f);
}

.trend-bar.share,
.trend-chip.share {
  background: linear-gradient(180deg, #7bb56c, #5b8f4d);
}

.trend-bar.vote,
.trend-chip.vote {
  background: linear-gradient(180deg, #8ab4ff, #4c79d8);
}

.trend-chip {
  color: #fff;
  border-color: transparent;
}

.stat-card.compact {
  min-width: 0;
}

.stat-card.compact strong {
  font-size: 20px;
}

.directory-card h3 {
  font-size: 24px;
}

.directory-card .meta-copy {
  margin: 0;
}

.cta-bar {
  margin-top: 18px;
  align-items: center;
}

.footer {
  margin-top: 18px;
  padding: 22px 24px 10px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 244, 0.82);
}

.footer-copy {
  margin: 0 0 10px;
}

.footer-links {
  margin-bottom: 10px;
}

.empty-state {
  padding: 40px 18px;
  text-align: center;
}

.fruit-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  max-width: min(88vw, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(49, 32, 20, 0.92);
  color: #fffaf4;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 16px 40px rgba(49, 32, 20, 0.22);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

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

@media (max-width: 960px) {
  .hero-grid,
  .trust-panel,
  .detail-grid,
  .result-layout,
  .all-layout,
  .feature-grid,
  .deliverable-grid,
  .fruit-grid,
  .directory-grid,
  .directory-card {
    grid-template-columns: 1fr;
  }

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

  .directory-card img {
    max-width: 220px;
  }

  .trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
  }

  .hero,
  .panel,
  .detail-hero,
  .result-card,
  .poster-card {
    padding: 20px;
    border-radius: 26px;
  }

  .topbar {
    align-items: flex-start;
  }

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

  .hero-copy {
    order: 2;
  }

  .hero-visual {
    order: 1;
    padding: 14px;
  }

  .top-actions {
    width: 100%;
  }

  .pill-link,
  .ghost-link,
  .cta-button,
  .secondary-button {
    flex: 1 1 auto;
  }

  .question-header {
    flex-direction: column;
  }

  .trait-row {
    grid-template-columns: 70px minmax(0, 1fr) 38px;
    gap: 8px;
  }

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