/* ============================================================
   香水人格鉴定所 · 视觉层
   纸张 / 墨水 / 印章 / 实验室档案
   ============================================================ */

:root {
  --paper: #e8e2d4;
  --paper-2: #efeadd;
  --paper-3: #f4f0e5;
  --ink: #1b1712;
  --muted: #615a4f;
  --line: rgba(27, 23, 18, 0.16);
  --line-strong: rgba(27, 23, 18, 0.45);
  --stamp: #a63226;
  --serif: "Bodoni Moda", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 24px 60px rgba(27, 23, 18, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(255, 252, 243, 0.55), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }
body.has-actionbar { padding-bottom: 96px; }

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(clamp(20px, 4vw, 48px), calc((100vw - 1124px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(232, 226, 212, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand__en {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.brand__zh {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.topbar__nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.topbar__nav a:hover { border-color: var(--ink); }

.topbar__no { color: var(--muted); }

/* ---------- 通用 ---------- */
main {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px) 40px;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--ink);
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 15px 26px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

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

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover { background: transparent; color: var(--ink); }

.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn--text {
  border-color: transparent;
  padding-left: 8px;
  padding-right: 8px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.btn--text:hover { color: var(--ink); background: transparent; }

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover { background: var(--ink); color: var(--paper); }

/* ---------- 首页 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: clamp(600px, calc(100vh - 150px), 840px);
  padding: clamp(36px, 6vh, 84px) 0 48px;
}

.hero__title {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(44px, 6.1vw, 88px);
  line-height: 1.17;
  letter-spacing: -0.025em;
}

.hero__title span { display: block; }

/* 第二行用细一档的同款宋体，靠字重差做层次，不再描边 */
.hero__title--line {
  white-space: nowrap;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.hero__last {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.hero__last:hover { border-color: var(--ink); }
.hero__last b { font-weight: 500; color: var(--ink); }

.hero__lede {
  max-width: 30em;
  margin: 30px 0 36px;
  font-size: 16px;
  line-height: 1.95;
  color: #4c463b;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__note {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hero__object {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  isolation: isolate;
}

.halo {
  position: absolute;
  width: min(480px, 84%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, rgba(232, 176, 75, 0.62), rgba(232, 176, 75, 0.12) 55%, transparent 70%);
  filter: blur(26px);
  animation: breathe 9s ease-in-out infinite;
  z-index: -1;
}

.bottle {
  width: clamp(220px, 24vw, 300px);
  height: auto;
  filter: drop-shadow(0 34px 42px rgba(27, 23, 18, 0.2));
  animation: float 7s ease-in-out infinite;
}

.bottle__liquid {
  animation: rise 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mist {
  position: absolute;
  top: 12%;
  right: 24%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  filter: blur(4px);
  opacity: 0;
  animation: mist 6s ease-out infinite;
}

.mist--b {
  top: 18%;
  right: 30%;
  animation-delay: 3s;
  width: 6px;
  height: 6px;
}

.stamp {
  position: absolute;
  top: 8%;
  right: 2%;
  z-index: 3;
  padding: 10px 14px 9px;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  transform: rotate(-9deg);
  opacity: 0.78;
  mix-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px rgba(166, 50, 38, 0.45);
}

.specimen-caption {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  white-space: nowrap;
}

/* 跑马灯 */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin-top: 6px;
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker 60s linear infinite;
}

.ticker:hover .ticker__track { animation-play-state: paused; }

.ticker__track span {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #3c362c;
  padding-right: 48px;
  white-space: nowrap;
}

/* 宣言 */
.manifesto {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(70px, 10vh, 120px) 0 20px;
}

.manifesto__lead {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.manifesto__body p {
  max-width: 36em;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.95;
  color: #4c463b;
}

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

.manifesto__sign {
  margin-top: 26px !important;
  padding-left: 14px;
  border-left: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px !important;
  letter-spacing: 0.06em;
  color: var(--muted) !important;
}

/* ---------- 答题 ---------- */
.quiz {
  max-width: 880px;
  margin: 0 auto;
  padding-top: clamp(28px, 5vh, 56px);
}

.quiz__bar {
  display: flex;
  align-items: center;
  gap: 18px;
}

.progress {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--line);
  overflow: hidden;
}

.progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--ink);
  transition: width 0.35s ease;
}

.quiz__count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  min-width: 66px;
  text-align: right;
}

.quiz__inner {
  padding: clamp(40px, 7vh, 72px) 0 40px;
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.quiz__tag {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.quiz__tag::before { content: "/ "; }

.quiz__prompt {
  max-width: 21em;
  margin: 18px 0 42px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.42;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

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

.option {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 17px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.14);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.option:hover,
.option.is-selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateX(3px);
}

.option__body {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}

.option__key {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 10px;
  transition: border-color 0.18s;
}

.option:hover .option__key,
.option.is-selected .option__key { border-color: rgba(232, 226, 212, 0.55); }

.option__label {
  font-size: 16px;
  line-height: 1.5;
}

.option__detail {
  display: block;
  width: 100%;
  padding-left: 40px;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.18s;
}

.option:hover .option__detail,
.option.is-selected .option__detail { color: rgba(232, 226, 212, 0.68); }

.option--swatch {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
}

.option--swatch .option__body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.option--swatch .option__label { font-size: 14px; }

.swatch {
  position: relative;
  display: block;
  width: 100%;
  height: 150px;
  border: 1px solid rgba(27, 23, 18, 0.35);
  border-radius: 8px 8px 24px 24px;
  transition: transform 0.25s ease;
}

.swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.55), transparent 38%, rgba(255, 255, 255, 0.06) 72%, rgba(255, 255, 255, 0.34));
}

.swatch__cap {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 40px;
  height: 12px;
  transform: translateX(-50%);
  background: var(--ink);
  border-radius: 2px 2px 0 0;
}

.option--swatch:hover .swatch { transform: translateY(-3px); }

.options--swatch {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.quiz__hint {
  margin: 28px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- 结果 ---------- */
.dossier {
  position: relative;
  max-width: 1000px;
  margin: 44px auto 0;
  padding: clamp(22px, 4.4vw, 56px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 140px),
    var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: 14px 14px 0 rgba(27, 23, 18, 0.07);
}

.dossier__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.preview-note {
  margin: 18px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--stamp);
  background: rgba(166, 50, 38, 0.06);
  font-size: 12px;
  line-height: 1.7;
}

.preview-note a {
  color: var(--stamp);
  text-underline-offset: 3px;
}

.result-head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding-top: 34px;
}

.result-code { display: flex; gap: 10px; }

.result-code__cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 52px;
}

.result-code__letter {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(46px, 5.6vw, 70px);
  line-height: 0.9;
  -webkit-text-stroke: 0.7px var(--ink);
}

.result-code__axis {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
  color: #4c463b;
  white-space: nowrap;
}

.result-family {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.egg-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid var(--stamp);
  color: var(--stamp);
  font-size: 9px;
  letter-spacing: 0.14em;
  vertical-align: 1px;
}

.result-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(42px, 6.4vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.result-alias {
  margin: 12px 0 0;
  max-width: 26em;
  font-size: 15px;
  line-height: 1.7;
  color: #4c463b;
}

.stamp--result {
  position: absolute;
  top: 6px;
  right: 0;
  font-size: clamp(12px, 1.4vw, 17px);
  animation: stampIn 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) 0.2s both;
}

.result-review {
  margin: 38px 0 6px;
  padding-left: 18px;
  border-left: 2px solid var(--l1, var(--ink));
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 27px);
  line-height: 1.65;
  color: #2f2a21;
}

.result-desc {
  max-width: 36em;
  margin: 18px 0 4px;
  font-size: 15px;
  line-height: 1.95;
  color: #3c362c;
}

.result-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  margin: 26px 0 8px;
}

.bloom { margin: 0; }

.bloom canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.bloom figcaption {
  margin-top: 6px;
  text-align: center;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.result-meters {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.meter__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.meter__head span:last-child { color: var(--muted); }

.meter__head b {
  color: var(--ink);
  font-weight: 500;
}

.meter__track {
  position: relative;
  height: 3px;
  background: rgba(27, 23, 18, 0.13);
}

.meter__center {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: 9px;
  background: rgba(27, 23, 18, 0.35);
}

.meter__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0.9;
}

.meter__fill.is-a { background: var(--l1, var(--ink)); }

.meter__fill.is-b { background: var(--l2, var(--muted)); }

.meter__mark {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 11px;
  background: var(--ink);
  transform: translateX(-50%);
}

.meter__poles {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.close-note {
  margin: 2px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--l2, var(--line));
  font-size: 11px;
  line-height: 1.75;
  color: #6b4a2f;
}

.confidence {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.dossier-section {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 18px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.dossier-section--last { padding-bottom: 8px; }

.dossier-section__label {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
}

.pyramid__row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 8px 0;
}

.pyramid__row + .pyramid__row { border-top: 1px dotted var(--line); }

.pyramid__name {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

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

.notes span {
  padding: 5px 11px;
  border: 1px solid var(--line);
  background: var(--paper-3);
  font-size: 13px;
  line-height: 1.4;
}

.manual {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.manual__item span {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.manual__item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}

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

.relation {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.relation:hover { background: var(--ink); color: var(--paper); }

.relation__tag {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.relation:hover .relation__tag { color: rgba(232, 226, 212, 0.6); }

.relation strong {
  display: block;
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.relation strong em {
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.relation:hover strong em { color: rgba(232, 226, 212, 0.6); }

.relation p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: #4c463b;
}

.relation:hover p { color: rgba(232, 226, 212, 0.82); }

.signature {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.signature__bottle {
  position: relative;
  flex: none;
  width: 52px;
  height: 82px;
  border: 1px solid var(--ink);
  border-radius: 5px 5px 13px 13px;
}

.signature__bottle::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 20px;
  height: 9px;
  transform: translateX(-50%);
  background: var(--ink);
  border-radius: 2px 2px 0 0;
}

.signature__bottle i {
  position: absolute;
  top: 0;
  left: 7px;
  width: 3px;
  height: 100%;
  background: rgba(255, 255, 255, 0.45);
}

.signature__name {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.signature__meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.barcode {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 42px;
  margin-left: auto;
  opacity: 0.8;
}

.barcode i {
  display: block;
  height: 100%;
  background: var(--ink);
}

.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px max(16px, calc((100vw - 1000px) / 2));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(232, 226, 212, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.actionbar .btn {
  padding: 12px 22px;
  font-size: 13px;
}

/* ---------- 十六型 ---------- */
.gallery { padding-top: clamp(40px, 7vh, 72px); }

.gallery__title {
  margin: 18px 0 24px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(48px, 7.4vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.gallery__lede {
  max-width: 34em;
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  color: #4c463b;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 46px 0 36px;
}

.type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 216px;
  padding: 16px 16px 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.16);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  overflow: hidden;
}

.type-card:hover {
  transform: translateY(-3px);
  box-shadow: 7px 7px 0 rgba(27, 23, 18, 0.9);
  background: var(--paper-3);
}

.type-card.is-own {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  background: var(--paper-3);
}

.type-card.is-own .type-card__no { color: var(--stamp); }

.type-card--egg .type-card__code { color: var(--stamp); }

.type-card__no {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.type-card__code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
}

.type-card__name {
  margin-top: auto;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.type-card__alias {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.type-card__family {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.type-card__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--card1), var(--card2));
}

.gallery__cta { margin-bottom: 20px; }

/* ---------- 分享弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 18, 14, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay[hidden] { display: none; }

.share-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(560px, 100%);
  max-height: 94vh;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--ink);
  overflow: auto;
}

.share-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.share-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 64vh;
  object-fit: contain;
  border: 1px solid var(--line);
  background: var(--paper);
}

.share-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-modal__actions .btn {
  padding: 11px 18px;
  font-size: 12px;
}

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 200;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

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

/* ---------- 页脚 ---------- */
.footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1220px;
  margin: 60px auto 0;
  padding: 26px clamp(20px, 4vw, 48px) 44px;
  border-top: 1px solid var(--line);
}

.footer p { margin: 0; }

.footer__legal {
  font-family: var(--serif);
  font-size: 13px;
  color: #4c463b;
}

.footer__meta {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ---------- 移动端保存引导 ---------- */
.save-sheet {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  background: rgba(20, 18, 14, 0.9);
  overflow: auto;
}

.save-sheet[hidden] { display: none; }

.save-sheet__hint {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--paper);
  text-align: center;
}

.save-sheet img {
  display: block;
  max-width: min(100%, 520px);
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
  background: var(--paper);
}

.save-sheet .btn {
  justify-self: center;
  color: var(--paper);
  border-color: rgba(232, 226, 212, 0.6);
}

/* ---------- 找不到的档案 ---------- */
.missing {
  max-width: 760px;
  padding-top: clamp(48px, 10vh, 120px);
}

.missing__title {
  margin: 18px 0 22px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(46px, 7.6vw, 92px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.missing__lede {
  max-width: 32em;
  margin: 0 0 30px;
  font-size: 15px;
  line-height: 1.95;
  color: #4c463b;
}

/* ---------- 动效 ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-22deg) scale(1.65); }
  70% { opacity: 0.82; transform: rotate(-8deg) scale(0.96); }
  100% { opacity: 0.78; transform: rotate(-9deg) scale(1); }
}

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

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

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

@keyframes mist {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  18% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(-22px, -46px) scale(1.9); }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 44px;
  }

  .hero__object {
    min-height: 440px;
    order: 2;
  }

  .bottle { width: 180px; }

  .hero__title { font-size: clamp(50px, 10vw, 82px); }

  .manifesto { grid-template-columns: 1fr; gap: 26px; }

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

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

  .bloom { max-width: 360px; margin: 0 auto; }

  .dossier-section { grid-template-columns: 1fr; gap: 10px; }

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

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

  .stamp--result { top: 0; }
}

@media (max-width: 700px) {
  .brand__zh { display: none; }

  .topbar__no { display: none; }

  .dossier__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .result-head { padding-top: 74px; }

  .stamp--result {
    top: 0;
    right: 0;
    font-size: 11px;
    padding: 7px 9px 6px;
    transform: rotate(-5deg);
  }

  .actionbar {
    justify-content: stretch;
  }

  .actionbar .btn { flex: 1; padding: 12px 10px; }

  .actionbar .btn--text { flex: 0 0 auto; }

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

  .signature { flex-wrap: wrap; }

  .barcode { margin-left: 0; width: 100%; justify-content: flex-end; }

  .share-modal { padding: 12px; }
}

@media (max-width: 520px) {
  .hero__title { font-size: clamp(44px, 13vw, 66px); }

  .hero__lede { font-size: 15px; }

  .hero__actions .btn { flex: 1; }

  .hero__object { min-height: 380px; }

  .bottle { width: 156px; }

  .stamp { top: 4%; right: 0; font-size: 13px; }

  .specimen-caption { font-size: 8px; letter-spacing: 0.1em; }

  .quiz__prompt { font-size: 26px; }

  .option { padding: 14px; gap: 12px; }

  .option__label { font-size: 14px; }

  .options--swatch { gap: 10px; }

  .swatch { height: 110px; }

  .option--swatch { padding: 10px; }

  .dossier { box-shadow: 7px 7px 0 rgba(27, 23, 18, 0.07); }

  .result-name { font-size: clamp(40px, 12vw, 58px); }

  .manual { grid-template-columns: 1fr; gap: 16px; }

  .type-grid { gap: 8px; }

  .type-card { min-height: 190px; padding: 12px 12px 18px; }

  .type-card__name { font-size: 20px; }

  .footer { flex-direction: column; gap: 8px; }

  .toast { bottom: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
