:root {
  --ink: #17211d;
  --muted: #66736b;
  --paper: #f7f8f4;
  --paper-2: #e5ece7;
  --moss: #1e594e;
  --moss-2: #347765;
  --gold: #9c6f38;
  --clay: #b86c45;
  --line: rgba(30, 89, 78, 0.2);
  --shadow: 0 22px 70px rgba(23, 33, 29, 0.16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(120deg, rgba(247, 248, 244, .96), rgba(214, 227, 222, .94)),
    radial-gradient(circle at 18% 12%, rgba(184, 108, 69, .13), transparent 30%),
    radial-gradient(circle at 88% 20%, rgba(32, 96, 86, .18), transparent 34%),
    #d9e3df;
}

.basic-protection body {
  -webkit-user-select: none;
  user-select: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 2px solid rgba(30, 89, 78, .34);
  outline-offset: 3px;
}

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

.hero-panel,
.test-panel,
.result-panel {
  min-height: calc(100vh - 56px);
  border: 1px solid var(--line);
  background: rgba(247, 248, 244, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: 26px;
  padding: clamp(24px, 5vw, 58px);
  overflow: hidden;
}

.hero-copy { max-width: 510px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 18px;
  font-size: clamp(40px, 7vw, 88px);
  line-height: .94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 17px;
}

.intro {
  color: #46534c;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.8;
}

.hero-actions,
.detail-actions,
.test-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary,
.ghost {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.primary {
  color: #fffaf1;
  background: linear-gradient(135deg, var(--moss), var(--moss-2));
  box-shadow: 0 12px 30px rgba(30, 89, 78, .24);
}

.ghost {
  border: 1px solid rgba(30, 89, 78, .22);
  background: rgba(255, 255, 250, .66);
}

.small {
  min-height: 40px;
  padding-inline: 14px;
  font-size: 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.hero-art {
  width: 100%;
  max-height: 78vh;
  object-fit: cover;
  border: 1px solid rgba(30, 89, 78, .18);
  box-shadow: 0 20px 60px rgba(23, 33, 29, .18);
}

.test-panel,
.result-panel {
  padding: clamp(22px, 5vw, 54px);
}

.test-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
  margin-bottom: 34px;
}

.progress-wrap {
  width: min(300px, 42vw);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.progress-track {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  background: rgba(30, 89, 78, .13);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--moss));
  transition: width .25s ease;
}

.question {
  max-width: 800px;
  margin-bottom: 22px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.35;
  font-weight: 900;
}

.multi-hint {
  position: sticky;
  top: 10px;
  z-index: 6;
  display: inline-flex;
  max-width: 100%;
  margin: -6px 0 16px;
  padding: 8px 12px;
  border: 1px solid rgba(156, 111, 56, .26);
  border-radius: 8px;
  background: rgba(255, 250, 240, .94);
  color: #7a5b2d;
  box-shadow: 0 10px 26px rgba(23, 33, 29, .08);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.55;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.option {
  position: relative;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(30, 89, 78, .18);
  border-radius: 8px;
  text-align: left;
  background: rgba(255, 255, 250, .7);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

@media (hover: hover) {
  .option:hover {
    transform: translateY(-2px);
    border-color: rgba(30, 89, 78, .42);
    background: rgba(255, 250, 240, .92);
  }

  .options.suppress-hover .option:hover {
    transform: none;
    border-color: rgba(30, 89, 78, .18);
    background: rgba(255, 255, 250, .7);
  }
}

.option.selected,
.option[aria-pressed="true"] {
  border-color: var(--moss);
  background: rgba(232, 243, 236, .96);
  box-shadow: inset 0 0 0 2px rgba(30, 89, 78, .12);
}

.option.selected::after,
.option[aria-pressed="true"]::after {
  content: "✓ 已选";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--moss);
  color: #fffaf1;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
}

.multi-options.multi-full .option:not(.selected):not([aria-pressed="true"]) {
  opacity: .48;
}

.multi-options .option {
  min-height: 92px;
  padding: 15px 82px 15px 16px;
}

.multi-options .option.selected,
.multi-options .option[aria-pressed="true"] {
  opacity: 1;
}

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

.option span {
  color: #5c685f;
  line-height: 1.55;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(320px, .58fr);
  gap: 14px;
}

.result-card,
.detail-panel {
  border: 1px solid rgba(30, 89, 78, .18);
  border-radius: 8px;
  background: rgba(255, 255, 250, .78);
}

.result-card {
  --card-main: var(--moss);
  --card-accent: var(--gold);
  --card-pale: #dfe8da;
  min-height: 0;
  padding: clamp(22px, 3.4vw, 40px);
  background: rgba(255, 255, 250, .9);
  position: relative;
  overflow: hidden;
}

.poster-head {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(220px, .55fr);
  gap: clamp(16px, 2.4vw, 24px);
  align-items: center;
}

.poster-copy {
  position: relative;
  z-index: 2;
}

.result-card h2 {
  font-size: clamp(30px, 4.2vw, 54px);
}

.result-code {
  margin-bottom: 18px;
  color: var(--card-main);
  font-weight: 900;
}

.verdict {
  max-width: 740px;
  color: #27342f;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.55;
  font-weight: 900;
}

.entertainment-note {
  margin: -8px 0 14px;
  color: rgba(83, 97, 89, .72);
  font-size: 12px;
  font-weight: 800;
}

.badge-row,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge,
.chip {
  border: 1px solid rgba(30, 89, 78, .2);
  border-radius: 999px;
  background: rgba(247, 248, 244, .86);
  color: #314138;
  font-size: 12px;
  font-weight: 800;
}

.badge { padding: 8px 11px; }
.chip { padding: 8px 10px; }

.fortune-cta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 14px 0 12px;
  padding: 15px;
  border: 1px solid rgba(44, 119, 82, .36);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(234, 246, 236, .96), rgba(255, 250, 238, .96));
  box-shadow: 0 14px 30px rgba(23, 33, 29, .1);
}

.fortune-cta strong,
.fortune-cta span {
  display: block;
}

.fortune-cta strong {
  color: #24342e;
  font-size: 17px;
  font-weight: 1000;
}

.fortune-cta span {
  margin-top: 5px;
  color: #6b5d45;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.fortune-cta .primary {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 12px 16px;
  font-size: 14px;
}

.card-stage {
  position: relative;
  display: grid;
  min-height: 300px;
  width: 100%;
  place-items: center;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.card-stage::before,
.card-stage::after {
  display: none;
}

.card-stage::before {
  inset: 18px;
  border-radius: 50%;
  opacity: .35;
}

.card-stage::after {
  width: 140px;
  height: 140px;
  right: -42px;
  top: -42px;
  transform: rotate(18deg);
  opacity: .28;
}

.sigil {
  display: none;
}

.avatar {
  display: grid;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  justify-self: center;
}

.avatar-art {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  filter: none;
  transform: none;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.avatar-fallback svg {
  width: 310px;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  filter: none;
}

.role-name {
  display: none;
}

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

.stat-list div {
  padding: 14px;
  border: 1px solid rgba(30, 89, 78, .12);
  border-radius: 8px;
  background: rgba(255, 255, 250, .68);
}

.stat-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stat-list dd {
  margin: 6px 0 0;
  font-weight: 900;
}

.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.detail-block {
  padding: 14px;
  border: 1px solid rgba(30, 89, 78, .13);
  border-radius: 8px;
  background: rgba(247, 248, 244, .66);
}

.detail-block h3 {
  margin-bottom: 10px;
  color: #24342e;
  font-size: 15px;
}

.detail-block p {
  margin-bottom: 0;
  color: #4b5951;
  line-height: 1.7;
}

.profile-grid {
  display: grid;
  gap: 10px;
}

.profile-item {
  padding: 12px;
  border: 1px solid rgba(30, 89, 78, .14);
  border-radius: 8px;
  background: rgba(255, 255, 250, .68);
}

.profile-item b {
  display: block;
  color: var(--moss);
  font-size: 12px;
  font-weight: 1000;
}

.profile-item strong {
  display: block;
  margin-top: 4px;
  color: #17211d;
  font-size: 16px;
  font-weight: 1000;
}

.profile-item span {
  display: block;
  margin-top: 6px;
  color: #536159;
  font-size: 13px;
  line-height: 1.55;
}

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

.share-block {
  border-color: rgba(156, 111, 56, .28);
  background: rgba(255, 255, 250, .84);
}

.share-block h3 {
  color: var(--gold);
}

.result-share-block {
  position: relative;
  z-index: 2;
  margin-top: 14px;
}

.share-grid .small {
  width: 100%;
  padding-inline: 10px;
}

.share-help {
  margin-top: 10px;
  color: #59645e;
  font-size: 12px;
  line-height: 1.6;
}

.share-copy-text {
  display: block;
  width: 100%;
  min-height: 86px;
  margin-top: 10px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid rgba(30, 89, 78, .18);
  border-radius: 8px;
  background: #fffef8;
  color: #24352e;
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
}

.share-preview {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin-top: 12px;
  border: 1px solid rgba(30, 89, 78, .16);
  border-radius: 8px;
  background: #fffef8;
}

.share-download {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 8px;
  color: #fffaf1;
  background: var(--moss);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.fortune-block {
  margin-top: 14px;
  border-color: rgba(30, 89, 78, .22);
  background: rgba(247, 248, 244, .82);
}

.fortune-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.fortune-head h3 {
  margin-bottom: 0;
}

.fortune-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(156, 111, 56, .24);
  border-radius: 999px;
  color: #7a5b2d;
  background: rgba(255, 250, 240, .8);
  font-size: 12px;
  font-weight: 1000;
  white-space: nowrap;
}

.fortune-birth {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.fortune-birth label {
  color: #536159;
  font-size: 12px;
  font-weight: 900;
}

.fortune-birth input {
  width: min(260px, 100%);
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(30, 89, 78, .22);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 250, .78);
  font: inherit;
  font-weight: 800;
}

.fortune-locked {
  padding: 14px;
  border: 1px dashed rgba(156, 111, 56, .34);
  border-radius: 8px;
  background: rgba(255, 250, 240, .72);
}

.fortune-locked p {
  margin: 0;
  color: #675844;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 800;
}

.fortune-preview {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(30, 89, 78, .16);
  border-radius: 8px;
  background: rgba(255, 255, 250, .7);
}

.fortune-preview b {
  display: block;
  margin-bottom: 6px;
  color: #24342e;
  font-size: 14px;
}

.fortune-preview span {
  display: block;
  color: #59645e;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 800;
}

.fortune-content {
  display: grid;
  gap: 16px;
}

.fortune-content h4 {
  margin: 0 0 10px;
  color: var(--moss);
  font-size: 14px;
}

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

.fortune-item {
  padding: 13px;
  border: 1px solid rgba(30, 89, 78, .14);
  border-radius: 8px;
  background: rgba(255, 255, 250, .72);
}

.fortune-item b {
  display: block;
  margin-bottom: 6px;
  color: #17211d;
  font-size: 15px;
}

.fortune-item p {
  margin: 0;
  color: #4b5951;
  font-size: 13px;
  line-height: 1.7;
}

.fortune-item strong {
  color: var(--gold);
}

.fortune-task {
  border-color: rgba(185, 133, 53, .26);
  background: rgba(255, 250, 240, .74);
}

.fortune-panel {
  width: min(940px, 100%);
}

.modal-birth {
  margin-bottom: 14px;
}

.fortune-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.fortune-type-btn {
  min-height: 48px;
  padding: 8px 9px;
  border: 1px solid rgba(30, 89, 78, .18);
  border-radius: 8px;
  background: rgba(255, 255, 250, .72);
  color: #314138;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.fortune-type-btn[aria-pressed="true"] {
  border-color: var(--moss);
  background: rgba(232, 243, 236, .96);
  color: var(--moss);
}

.modal-fortune-content {
  padding-top: 14px;
  border-top: 1px solid rgba(30, 89, 78, .14);
}

.site-footer {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(30, 89, 78, .18);
  border-radius: 8px;
  background: rgba(247, 248, 244, .7);
  color: #536159;
  font-size: 12px;
  line-height: 1.7;
}

.site-footer p {
  margin: 0 0 6px;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.beian-placeholder {
  color: #7a6c58;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--moss);
  background: transparent;
  font-size: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 29, 25, .42);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid rgba(30, 89, 78, .22);
  border-radius: 8px;
  background: rgba(247, 248, 244, .96);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin-bottom: 0;
}

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

.type-item {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 112px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--type-color, var(--moss)) 24%, transparent);
  border-radius: 8px;
  background:
    radial-gradient(circle at 94% 12%, color-mix(in srgb, var(--type-accent, var(--gold)) 20%, transparent), transparent 34%),
    rgba(255, 255, 250, .72);
}

.type-thumb {
  width: 92px;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(30, 89, 78, .16);
  border-radius: 8px;
  background: #fbf6ea;
  object-fit: cover;
}

.type-mark {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  min-height: 28px;
  margin-bottom: 8px;
  padding: 0 8px;
  border-radius: 8px;
  color: #fffaf1;
  background: var(--type-color, var(--moss));
  font-size: 13px;
  font-weight: 1000;
}

.type-item h3 {
  margin: 0 0 4px;
  color: var(--type-color, var(--moss));
  font-size: 18px;
}

.type-item p {
  margin: 0;
  color: #536159;
  font-size: 13px;
  line-height: 1.55;
}

.type-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.type-meta span {
  padding: 5px 7px;
  border: 1px solid rgba(30, 89, 78, .15);
  border-radius: 999px;
  background: rgba(247, 248, 244, .75);
  color: #364940;
  font-size: 12px;
  font-weight: 800;
}

.privacy-panel {
  width: min(760px, 100%);
}

.privacy-copy p {
  margin: 0 0 14px;
  color: #415047;
  line-height: 1.8;
}

@media (max-width: 840px) {
  .app-shell {
    width: min(100% - 20px, 1160px);
    padding: max(10px, env(safe-area-inset-top)) 0 max(10px, env(safe-area-inset-bottom));
  }
  .hero-panel,
  .test-panel,
  .result-panel { min-height: calc(100vh - 20px); }
  .hero-panel,
  .result-grid { grid-template-columns: 1fr; }
  .result-panel { padding: 0; }
  .result-card {
    min-height: 0;
    padding: 18px;
  }
  .poster-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .result-card h2 {
    font-size: clamp(30px, 8.6vw, 38px);
    line-height: 1.08;
  }
  .result-code { margin-bottom: 14px; }
  .verdict {
    font-size: clamp(19px, 5vw, 24px);
    line-height: 1.55;
  }
  .badge-row { gap: 7px; }
  .badge,
  .chip {
    font-size: 12px;
    padding: 7px 9px;
  }
  .fortune-cta {
    display: grid;
    gap: 10px;
  }
  .fortune-cta .primary {
    width: 100%;
  }
  .card-stage {
    min-height: 0;
    contain: layout paint;
  }
  .avatar {
    width: 100%;
    max-width: 280px;
  }
  .avatar-art {
    width: min(280px, 100%);
    max-width: 100% !important;
    height: auto !important;
  }
  .avatar-fallback svg {
    width: min(270px, 100%);
    max-width: 100%;
    max-height: 100%;
  }
  .hero-art { max-height: 42vh; }
  .test-top { display: block; }
  .progress-wrap { width: 100%; margin-top: 18px; text-align: left; }
  .options { grid-template-columns: 1fr; }
  .stat-list {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 20px;
  }
  .stat-list div { padding: 12px; }
  .detail-panel {
    gap: 10px;
    padding: 10px;
  }
  .detail-block { padding: 13px; }
  .type-modal { padding: 10px; }
  .modal-head { display: block; }
  .modal-head .ghost { margin-top: 12px; }
  .type-list { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-grid .small {
    min-height: 42px;
    padding-inline: 8px;
    font-size: 12px;
  }
  .fortune-head { display: block; }
  .fortune-state { margin-top: 8px; }
  .fortune-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
