:root {
  --bg0: #e8f3ef;
  --bg1: #f7f1e6;
  --ink: #1a1f1c;
  --muted: #5c675f;
  --card: #fffdf8;
  --line: #1a1f1c;
  --accent: #ff7a45;
  --accent-soft: #ffd2bc;
  --mark: #ffe17a;
  --ok: #2f9e6b;
  --meter: #3a7ca5;
  --tape: #f0d9a8;
  --shadow: 4px 4px 0 #1a1f1c;
  --radius: 18px;
  --font-display: "ZCOOL KuaiLe", "Fredoka", "PingFang SC", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1000px 500px at 10% -10%, #d9efe6 0%, transparent 55%),
    radial-gradient(800px 420px at 100% 0%, #ffe8d6 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
}

button,
input {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 14px 0;
}

.top-bar {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 253, 248, 0.92);
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 7px 12px 7px 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.12s ease, transform 0.1s ease;
}

.home-btn .ico {
  width: 16px;
  height: 16px;
  display: block;
}

.home-btn:hover {
  background: var(--accent-soft);
}

.home-btn:active {
  transform: translateY(1px);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  flex: 1;
  text-align: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
}

@media (max-width: 520px) {
  .brand {
    display: none;
  }
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  transition: transform 0.12s ease, background 0.12s ease;
}

.icon-btn .ico,
.icon-btn .ki {
  width: 1.05em;
  height: 1.05em;
  font-size: 18px;
  display: block;
}

.icon-btn:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn.is-muted {
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-wrap {
  position: relative;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(340px, 86vw);
  padding: 12px;
  z-index: 50;
  background: #fffdf8;
  border: 2px solid var(--line);
  border-radius: 16px;
  box-shadow: 4px 4px 0 #1a1f1c;
}

.lang-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-weight: 800;
  font-size: 0.95rem;
}

.lang-head .ico {
  width: 16px;
  height: 16px;
}

.lang-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lang-opt {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 12px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
  cursor: pointer;
  min-height: 44px;
}

.lang-opt:hover {
  background: #f7f2ea;
}

.lang-opt.is-on {
  background: #e8e4f8;
}

.lang-opt .check {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink);
}

.lang-opt:not(.is-on) .check {
  display: none;
}

/* Layout */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 56px;
}

.view {
  animation: rise 0.35s ease both;
}

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

/* Hero */
.hero-art {
  position: relative;
  height: 170px;
  border: 2px solid var(--line);
  border-radius: 22px 22px 16px 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  background: #16352f;
}

.strata-bg {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
}

.strata-bg i {
  display: block;
}

.strata-bg i:nth-child(1) {
  background: #6b4c9a;
}
.strata-bg i:nth-child(2) {
  background: #3a7ca5;
}
.strata-bg i:nth-child(3) {
  background: #2f9e6b;
}
.strata-bg i:nth-child(4) {
  background: #e6c35c;
}
.strata-bg i:nth-child(5) {
  background: #e07a3d;
}
.strata-bg i:nth-child(6) {
  background: #c4473a;
}

.hero-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-icons span {
  position: absolute;
  font-size: 1.35rem;
  filter: grayscale(0.2);
  opacity: 0.9;
  animation: floaty 4.5s ease-in-out infinite;
}

.hero-icons span:nth-child(1) {
  left: 8%;
  top: 18%;
}
.hero-icons span:nth-child(2) {
  left: 22%;
  top: 62%;
  animation-delay: 0.4s;
}
.hero-icons span:nth-child(3) {
  left: 70%;
  top: 22%;
  animation-delay: 0.8s;
}
.hero-icons span:nth-child(4) {
  left: 80%;
  top: 58%;
  animation-delay: 1.1s;
}
.hero-icons span:nth-child(5) {
  left: 48%;
  top: 72%;
  animation-delay: 0.2s;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.lens {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: 0 0 0 3px var(--line), 6px 6px 0 rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
}

.lens b {
  font-family: var(--font-display);
  font-size: 2rem;
  color: #fff;
  text-shadow: 2px 2px 0 #1a1f1c;
}

.lens::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -10px;
  width: 34px;
  height: 10px;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 6px;
  transform: rotate(42deg);
}

.hero-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.25;
}

.mark {
  background-image: linear-gradient(transparent 62%, var(--mark) 62%);
  padding: 0 0.08em;
}

.hero-sub {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.hero-facts {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.btn {
  appearance: none;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, background 0.12s ease;
}

.btn:hover {
  background: #fff7ef;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--line);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-go {
  background: var(--accent);
  color: #fff;
}

.btn-go:hover {
  background: #ff6930;
}

.btn-wide {
  width: 100%;
  padding: 16px;
  font-size: 1.15rem;
  border-radius: 16px;
}

.hero-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.fine {
  margin: 18px 0 0;
  color: #889088;
  font-size: 0.8rem;
  text-align: center;
}

/* Quiz */
.q-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.q-num {
  margin: 0;
  font-weight: 800;
  white-space: nowrap;
}

.q-num b {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-left: 2px;
}

.meter {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.meter-bar {
  height: 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.meter-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5fa8d3, var(--meter));
  transition: width 0.35s ease;
}

.paper {
  position: relative;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.taped::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%) rotate(-2deg);
  width: 78px;
  height: 18px;
  background: var(--tape);
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  opacity: 0.95;
}

.q-card {
  padding: 28px 20px 22px;
  text-align: center;
  margin-bottom: 14px;
}

.q-kind {
  margin: 0 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.q-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f3e4d2;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

.q-name {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.35;
}

.q-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.q-ask {
  margin: 12px 0 0;
  font-weight: 800;
}

.answers {
  display: grid;
  gap: 10px;
}

.ans {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.1s ease, background 0.12s ease;
}

.ans:hover {
  background: #fff4eb;
}

.ans:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.ans .idx {
  color: #9aa39b;
  font-variant-numeric: tabular-nums;
}

.ans.is-picked {
  background: var(--accent-soft);
}

.answers.is-locked .ans:not(.is-picked) {
  opacity: 0.45;
}

.q-hint {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

/* Reveal */
.rv {
  text-align: center;
  padding: 40px 12px 20px;
}

.rv-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
}

.rv-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  animation: blink 1.1s ease-in-out infinite;
}

.rv-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.rv-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.rv-line {
  margin: 0;
  font-weight: 800;
  font-size: 1.15rem;
}

.rv-age {
  margin: 10px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 4.5rem);
  line-height: 1;
}

.rv-age em {
  font-style: normal;
  font-size: 0.45em;
  margin-left: 4px;
}

.rv-q {
  margin: 0 0 12px;
  font-weight: 800;
}

.rv-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.rv-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.age-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.age-input {
  width: 96px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.link-btn {
  display: inline-block;
  margin-top: 10px;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 700;
}

.rv-skip {
  margin-top: 28px;
  color: #9aa39b;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Result */
.sheet {
  padding: 28px 20px 18px;
  text-align: center;
}

.res-head {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.res-you {
  margin: 8px 0 0;
  font-weight: 800;
}

.res-age {
  margin: 4px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 3.6rem);
}

.res-stamp {
  display: inline-block;
  margin: 4px 0 10px;
  padding: 6px 14px;
  border: 3px solid var(--ok);
  color: var(--ok);
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  transform: rotate(-6deg);
}

.res-stamp.miss {
  border-color: var(--accent);
  color: var(--accent);
}

.res-real,
.res-n {
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.res-sec {
  margin-top: 22px;
  text-align: left;
}

.res-h {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.strata {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
  height: 84px;
  padding: 8px;
  background: #f4eee4;
  border: 2px solid var(--line);
  border-radius: 12px;
}

.strata b {
  display: block;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #ff9a6b, #3a7ca5);
  min-height: 4px;
  border: 1.5px solid var(--line);
}

.strata-peak {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.res-keys {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.res-keys li {
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 0.92rem;
}

.res-keys .key-q {
  font-weight: 800;
}

.res-keys .key-a {
  color: var(--muted);
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.log {
  margin-top: 16px;
  padding: 8px 14px;
}

.log summary {
  cursor: pointer;
  font-weight: 800;
  padding: 8px 0;
}

.log-list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.log-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px dashed #d5d0c6;
  font-size: 0.88rem;
}

.log-n {
  font-weight: 800;
  color: #9aa39b;
}

/* FAQ */
.faq-sec {
  max-width: 720px;
  margin: 28px auto 8px;
  padding: 0 4px 24px;
}

.faq-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.55rem;
}

.faq-lead {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

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

.faq-item {
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  padding: 14px 16px;
  line-height: 1.35;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 900;
  color: var(--muted);
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin: 0;
  padding: 0 16px 14px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.site-foot {
  max-width: 720px;
  margin: 0 auto 28px;
  padding: 8px 16px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-foot a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.site-foot a:hover {
  text-decoration: underline;
}

.foot-links {
  margin: 6px 0 0;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 28, 24, 0.45);
  display: grid;
  place-items: end center;
  padding: 16px;
}

.modal-sheet {
  width: min(520px, 100%);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 18px 18px;
  position: relative;
  animation: rise 0.25s ease both;
}

.modal-sheet h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
}

.help-list {
  margin: 0 0 12px;
  padding-left: 1.2em;
  line-height: 1.55;
}

.help-list li + li {
  margin-top: 8px;
}

.help-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.modal-x {
  position: absolute;
  right: 10px;
  top: 10px;
}

@media (min-width: 720px) {
  .modal {
    place-items: center;
  }
}
