:root {
  --ink: #22322E;
  --ink-soft: #4C625B;
  --muted: #7E9189;
  --line: rgba(34, 50, 46, .12);
  --paper: #FFFFFF;
  --accent: #2E9E6B;
  --accent-soft: #EAF6EF;
  --font: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans SC', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background-color: #F4FAF6;
  background-image: radial-gradient(rgba(46, 158, 107, .13) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; color: inherit; }

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  background: linear-gradient(180deg, rgba(244, 250, 246, .96), rgba(244, 250, 246, .74));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 4px 8px 0;
  border: 0;
  background: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(46, 158, 107, .16);
}

.ghost-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.ghost-btn[hidden] { display: none; }

/* ---------- 转场 ---------- */
.screen-host {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}

.screen-host.in { opacity: 1; transform: none; }

/* ---------- 通用 ---------- */
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
}

h2 { margin: 0; font-size: 17px; font-weight: 700; }

h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}

.lede {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.btn {
  display: block;
  width: 100%;
  padding: 16px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(46, 158, 107, .26);
}

.btn.primary:active { transform: translateY(1px) scale(.995); }
.btn.primary:disabled { opacity: .7; cursor: default; transform: none; }

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover { border-color: rgba(46, 158, 107, .5); }

.text-btn {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}

/* ---------- 首页 ---------- */
.hero { padding: 6px 0 2px; text-align: center; }

.hero-art {
  width: min(58vw, 224px);
  aspect-ratio: 1;
  margin: 2px auto 14px;
  filter: drop-shadow(0 16px 26px rgba(46, 90, 68, .14));
}

.hero h1 { font-size: 44px; }

.hero .lede { margin-bottom: 26px; }

.last-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
  padding: 10px 14px 10px 10px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.last-art { flex: 0 0 52px; width: 52px; aspect-ratio: 1; }

.last-text { display: flex; flex-direction: column; gap: 3px; }
.last-text b { font-size: 14px; }
.last-text i { font-size: 12px; font-style: normal; color: var(--muted); }

.strip-block {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.strip {
  display: flex;
  gap: 10px;
  margin: 0 -20px;
  padding: 4px 20px 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar { display: none; }

.strip-item {
  flex: 0 0 88px;
  scroll-snap-align: start;
  padding: 8px 6px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}

.strip-item:hover { border-color: rgba(46, 158, 107, .55); transform: translateY(-2px); }

.strip-art { display: block; width: 100%; aspect-ratio: 1; }
.strip-name { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; }

/* ---------- 答题 ---------- */
.quiz-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #E4EFE8;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .3s ease;
}

.count {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.count em { font-style: normal; opacity: .55; }

.q-text {
  margin: 34px 0 22px;
  font-size: 24px;
  line-height: 1.55;
  font-weight: 700;
}

.options { display: grid; gap: 12px; }

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 18px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.55;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.option:hover { border-color: rgba(46, 158, 107, .55); }
.option.picked { border-color: var(--accent); background: var(--accent-soft); transform: scale(.992); }

.mark {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #EAF3ED;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.option.picked .mark { background: var(--accent); color: #fff; }

.quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}

.quiz-foot .btn { width: auto; padding: 11px 20px; font-size: 14px; }
.quiz-foot .btn[disabled] { opacity: .4; cursor: default; }

/* ---------- 分析中 ---------- */
.loading { padding: 56px 0 40px; text-align: center; }

.load-art {
  width: 180px;
  aspect-ratio: 1;
  margin: 0 auto 26px;
  animation: bob 1.9s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}

.load-line {
  margin: 0;
  font-size: 16px;
  color: var(--ink-soft);
}

.load-line.swap { animation: pop .32s ease; }

@keyframes pop {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: none; }
}

.load-dots { display: flex; justify-content: center; gap: 7px; margin-top: 18px; }

.load-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .35;
  animation: pulses 1.2s ease-in-out infinite;
}

.load-dots i:nth-child(2) { animation-delay: .16s; }
.load-dots i:nth-child(3) { animation-delay: .32s; }

@keyframes pulses {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* ---------- 结果 / 图鉴详情 ---------- */
.profile-head { padding: 4px 0 24px; text-align: center; }

.head-art {
  width: min(62vw, 232px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  filter: drop-shadow(0 16px 26px rgba(46, 90, 68, .14));
}

.type-name { font-size: 46px; }

.type-title {
  margin: 8px 0 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
}

.type-tagline {
  margin: 0 auto;
  max-width: 20em;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.band {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.body-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-soft);
}

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

.list li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.list li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.list.warn li::before { background: #E8A33D; }
.list.guide li::before { background: #6BA8D8; }

/* 三条轴 */
.axis { margin-bottom: 20px; }
.axis:last-child { margin-bottom: 0; }

.axis-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 14px;
  color: var(--muted);
}

.axis-top b { font-size: 14px; color: var(--ink); }

.track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #E8F0EA;
  overflow: hidden;
}

.track i { display: block; height: 100%; border-radius: 999px; }

.track span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, .92);
}

.axis-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}

.chips-band { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  color: var(--ink-soft);
}

/* 搭子 */
.pair {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px 11px 10px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pair.dim { opacity: .74; }
.pair-art { flex: 0 0 54px; width: 54px; aspect-ratio: 1; }
.pair-text { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.pair-text b { font-size: 14px; }
.pair-text i { font-size: 13px; font-style: normal; line-height: 1.6; color: var(--muted); }

/* 数据 */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.stat {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat span { display: block; margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.stat b { font-size: 26px; font-variant-numeric: tabular-nums; }
.stat b.small { display: block; font-size: 14px; font-weight: 600; line-height: 1.55; }

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

/* ---------- 全部形态 ---------- */
.all-head { padding: 8px 0 22px; text-align: center; }
.all-head h1 { font-size: 32px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}

.form-card:hover { border-color: rgba(46, 158, 107, .55); transform: translateY(-2px); }
.form-card b { font-size: 15px; }
.form-card i { font-size: 12px; font-style: normal; color: var(--accent); }
.form-art { display: block; width: 100%; aspect-ratio: 1; margin-bottom: 8px; }
.form-tag { margin-top: 5px; font-size: 12px; line-height: 1.6; color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (min-width: 720px) {
  .page { max-width: 680px; padding-top: 0; }
  .hero-art { width: min(32vw, 240px); }
  .head-art { width: min(30vw, 244px); }
  .form-grid { grid-template-columns: repeat(4, 1fr); }
  .type-name { font-size: 50px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 36px; }
  .type-name { font-size: 38px; }
  .q-text { font-size: 21px; margin-top: 28px; }
  .option { font-size: 15px; padding: 15px 15px; }
  .all-head h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------- 奶蛙模式 ---------- */
.ribbon {
  display: inline-block;
  margin: 12px 0 10px;
  padding: 10px 28px;
  border-radius: 999px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 8px 18px rgba(43, 38, 34, .16);
}

.art { display: block; width: 100%; height: 100%; }
.art-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hidden-tip { margin: 12px 0 0; font-size: 13px; color: #B4791F; }

.has-photo .ribbon { display: none; }

/* 奶蛙图片 */
.nawa-img { border-radius: 8px; background: #fff; }
.hero-art .nawa-img, .head-art .nawa-img { border-radius: 14px; }
.head-art, .hero-art { filter: none; }

/* 微信内长按保存 */
.card-save { position: fixed; inset: 0; z-index: 9998; display: grid; place-items: center; background: rgba(20,26,24,.8); padding: 20px; }
.card-save-box { width: min(92vw, 420px); max-height: 92vh; overflow: auto; padding: 18px; text-align: center; background: #fff; border-radius: 14px; }
.card-save-box b { display: block; margin-bottom: 12px; font-size: 16px; }
.card-save-box img { width: 100%; display: block; border-radius: 10px; }
.card-save-box i { display: block; margin: 12px 0; font-size: 12px; font-style: normal; color: #7E9189; line-height: 1.6; }
.card-save-box button { width: 100%; padding: 12px; border: 1px solid rgba(34,50,46,.12); border-radius: 999px; background: #fff; font-size: 15px; }
