/* 招财平安符页面样式。色调：玄墙、金莲、朱砂。 */

:root {
  --ink: #0b0908;
  --ink-2: #14100e;
  --ink-3: #1d1613;
  --gold: #dcb468;
  --gold-hi: #f8e7b6;
  --gold-lo: #9c7030;
  --gold-a: rgba(220, 180, 104, .68);
  --gold-b: rgba(220, 180, 104, .3);
  --gold-c: rgba(220, 180, 104, .15);
  --red: #d63a2a;
  --red-deep: #9d2118;
  --cream: #f1e8d5;
  --cream-a: rgba(241, 232, 213, .76);
  --cream-b: rgba(241, 232, 213, .48);
  --foil: linear-gradient(168deg, #fcefc6 0%, #e8c57e 30%, #b98a3e 58%, #f1d696 82%, #c89a4c 100%);
  --f-brush: "Ma Shan Zheng", "Kaiti SC", "STKaiti", "KaiTi", serif;
  --f-wei: "ZCOOL XiaoWei", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --f-song: "Noto Serif SC", "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  /* 页面最宽 480 像素。--vw 是页面宽度的百分之一。 */
  --vw: min(1vw, 4.8px);
  --pad: calc(var(--vw) * 6);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: #050403;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* 禁用下拉刷新和缩放。overscroll-behavior 管下拉刷新和顶部回弹，touch-action 管双指缩放和双击缩放。 */
html,
body {
  overscroll-behavior-y: none;
  touch-action: pan-x pan-y;
}

html.lock {
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--cream);
  font-family: var(--f-song);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
ul,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
  font-weight: inherit;
}

ul {
  list-style: none;
}

i {
  font-style: normal;
}

b {
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

img {
  display: block;
  max-width: none;
}

:focus-visible {
  outline: 1px solid var(--gold-hi);
  outline-offset: 3px;
}

.defs {
  position: absolute;
}

.dust {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 0;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(100% 46vh at 88% 0, rgba(128, 76, 30, .3), transparent 72%),
    radial-gradient(80% 40vh at 0 62vh, rgba(160, 44, 26, .12), transparent 70%),
    var(--ink);
}

/* 墙面的细颗粒 */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .92 0 0 0 0 .78 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page > * {
  position: relative;
  z-index: 1;
}

/* 金箔字 */
.title-line,
.head h2,
.card-name,
.count-days b,
.foot-main {
  background: var(--foil);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* 文字之间的小圆点 */
.topbar-date i,
.duty span i,
.seal-hint i,
.photo figcaption i,
.card-paper i,
.viewer-name i {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 .7em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  opacity: .8;
}

/* ---------- 莲纹 ---------- */

.lotus {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  aspect-ratio: 2 / 1;
}

.lotus img {
  position: absolute;
  left: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  animation: turn 150s linear infinite;
  will-change: transform;
}

.lotus-up {
  right: -17%;
  bottom: 54%;
  width: 96%;
  border-bottom: 1.5px solid var(--gold);
  opacity: .7;
}

.lotus-up img {
  top: 0;
}

.lotus-down {
  top: 46%;
  left: -24%;
  width: 90%;
  border-top: 1.5px solid var(--gold);
  opacity: .62;
}

.lotus-down img {
  bottom: 0;
  animation-direction: reverse;
}

@keyframes turn {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 首屏 ---------- */

.hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) var(--pad) calc(env(safe-area-inset-bottom, 0px) + 14px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--f-wei);
  font-size: 12.5px;
  line-height: 1;
  letter-spacing: .2em;
  color: var(--gold-a);
}

.topbar-date {
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 11px;
  border: 1px solid var(--gold-b);
  border-radius: 999px;
  background: rgba(220, 180, 104, .07);
  color: var(--gold-hi);
  letter-spacing: .14em;
  white-space: nowrap;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff9a4a;
  box-shadow: 0 0 8px 2px rgba(255, 122, 46, .8);
  animation: ember 2.4s ease-in-out infinite;
}

.title {
  margin-top: clamp(22px, 5.4vh, 54px);
  font-family: var(--f-brush);
  font-size: calc(var(--vw) * 27);
  font-size: min(calc(var(--vw) * 27), 15.5svh);
  line-height: 1;
  letter-spacing: .02em;
}

.title-line {
  display: block;
  width: fit-content;
  padding: .04em .06em .08em 0;
  background-image: linear-gradient(105deg, transparent 38%, rgba(255, 251, 232, .9) 50%, transparent 62%), var(--foil);
  background-repeat: no-repeat;
  background-size: 70% 100%, 100% 100%;
  background-position: -260% 0, 0 0;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .55));
}

.title-line-2 {
  position: relative;
  margin: -.06em 0 0 .5em;
}

.stamp {
  position: absolute;
  bottom: 1.5em;
  left: calc(100% + .35em);
  writing-mode: vertical-rl;
  height: calc(2.24em + .56em);
  padding: .28em .24em;
  border-radius: .22em;
  background: linear-gradient(150deg, #e2452f, var(--red-deep));
  box-shadow: inset 0 0 0 1.5px rgba(255, 232, 214, .28);
  color: #fdeedd;
  -webkit-text-fill-color: #fdeedd;
  font-family: var(--f-wei);
  font-size: .2em;
  line-height: 1.12;
  letter-spacing: 0;
  transform: rotate(-6deg);
  filter: url(#rough);
}

.lede {
  position: relative;
  z-index: 2;
  margin-top: clamp(12px, 2.6vh, 24px);
  padding-left: 14px;
  border-left: 1px solid var(--gold-b);
  color: var(--cream-a);
  font-size: 15px;
  line-height: 1.95;
  letter-spacing: .1em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .9);
}

.wall {
  margin-top: auto;
  padding-top: 26px;
}

.wall-stage {
  position: relative;
}

.wall-row,
.wall-tags {
  position: relative;
  z-index: 2;
  display: flex;
  gap: calc(var(--vw) * 1.9);
}

.wall-fu {
  flex: var(--ar) 1 0%;
  min-width: 0;
  transform: translateY(var(--y));
  transition: transform .7s var(--ease);
}

.paper {
  display: block;
  transform: rotate(var(--r));
  transform-origin: 50% 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .08) inset;
  transition: box-shadow .6s var(--ease), transform .6s var(--ease), filter 1s;
  animation: sway calc(5.6s + var(--d) * .37s) ease-in-out calc(var(--d) * -.9s) infinite;
}

.paper img {
  width: 100%;
  height: auto;
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(calc(var(--r) - .55deg));
  }
  50% {
    transform: rotate(calc(var(--r) + .55deg));
  }
}

.wall-fu.is-duty .paper {
  box-shadow: 0 0 0 1px rgba(248, 231, 182, .85), 0 0 22px 5px rgba(232, 190, 110, .6), 0 10px 18px rgba(0, 0, 0, .6);
}

.wall-fu.is-duty {
  transform: translateY(calc(var(--y) - 7px));
}

.wall-tags {
  margin-top: 16px;
  font-family: var(--f-wei);
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--gold-a);
}

.wall-tags span {
  flex: var(--ar) 1 0%;
  min-width: 0;
  display: flex;
  align-items: center;
  writing-mode: vertical-rl;
  letter-spacing: .12em;
  transition: color .6s;
}

.wall-tags span.is-duty {
  color: var(--gold-hi);
  text-shadow: 0 0 10px rgba(232, 190, 110, .9);
}

.duty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-family: var(--f-wei);
  font-size: 13px;
  line-height: 1;
  letter-spacing: .2em;
  color: var(--gold);
  white-space: nowrap;
}

.duty > i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-b));
}

.duty > i:last-child {
  transform: scaleX(-1);
}

.down {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: clamp(12px, 2.4vh, 22px);
  font-family: var(--f-wei);
  font-size: 11px;
  line-height: 1;
  letter-spacing: .4em;
  text-indent: .4em;
  color: var(--cream-b);
}

.down i {
  width: 1px;
  height: 22px;
  background: linear-gradient(var(--gold), transparent);
  transform-origin: 50% 0;
  animation: drip 2.4s var(--ease) infinite;
}

@keyframes drip {
  0% {
    transform: scaleY(0);
    opacity: 1;
  }
  60% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

/* 首屏入场。脚本可用时，入场前先隐藏。动画结束后，元素回到自身样式。 */
.js:not(.ready) .topbar,
.js:not(.ready) .lede,
.js:not(.ready) .wall-tags,
.js:not(.ready) .duty,
.js:not(.ready) .down,
.js:not(.ready) .hero .lotus,
.js:not(.ready) .wall-fu,
.js:not(.ready) .stamp {
  opacity: 0;
}

.js:not(.ready) .title-line {
  clip-path: inset(-12% 100% -12% -4%);
}

.js.ready .topbar {
  animation: fade 1s var(--ease) .05s backwards;
}

.js.ready .title-line {
  animation: brush .95s cubic-bezier(.5, .1, .2, 1) backwards, sheen 9s ease-in-out infinite;
}

.js.ready .title-line-1 {
  animation-delay: .15s, 2.6s;
}

.js.ready .title-line-2 {
  animation-delay: .55s, 2.9s;
}

.js.ready .stamp {
  animation: stamp .42s cubic-bezier(.2, 1.5, .4, 1) 1.6s backwards;
}

.js.ready .lede {
  animation: rise .9s var(--ease) 1.15s backwards;
}

.js.ready .hero .lotus-up {
  animation: bloom-up 1.9s var(--ease) .5s backwards;
}

.js.ready .hero .lotus-down {
  animation: bloom-down 1.9s var(--ease) .8s backwards;
}

.js.ready .wall-fu {
  animation: drop .8s cubic-bezier(.2, .9, .3, 1.15) calc(1.05s + var(--d) * .085s) backwards;
}

.js.ready .wall-tags {
  animation: fade 1s var(--ease) 1.9s backwards;
}

.js.ready .duty {
  animation: fade 1s var(--ease) 2.1s backwards;
}

.js.ready .down {
  animation: fade 1s var(--ease) 2.4s backwards;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes sheen {
  0% {
    background-position: -260% 0, 0 0;
  }
  22%,
  100% {
    background-position: 360% 0, 0 0;
  }
}

@keyframes brush {
  from {
    clip-path: inset(-12% 100% -12% -4%);
  }
  to {
    clip-path: inset(-12% -30% -12% -4%);
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: rotate(-14deg) scale(1.9);
  }
}

@keyframes bloom-up {
  from {
    opacity: 0;
    transform: translateY(8%) scale(.9);
  }
}

@keyframes bloom-down {
  from {
    opacity: 0;
    transform: translateY(-8%) scale(.9);
  }
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(calc(var(--y) - 30px));
  }
}

/* ---------- 段落标题 ---------- */

.head {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--pad);
  text-align: center;
}

.head-mark {
  position: relative;
  width: 7px;
  height: 7px;
  margin-bottom: 18px;
  background: var(--red);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(214, 58, 42, .8);
}

.head-mark::before,
.head-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-b), transparent);
  transform-origin: 0 50%;
}

.head-mark::before {
  left: 50%;
  transform: rotate(-45deg) translateX(12px);
}

.head-mark::after {
  left: 50%;
  transform: rotate(135deg) translateX(12px);
}

.head h2 {
  padding: .06em .1em;
  font-family: var(--f-brush);
  font-size: calc(var(--vw) * 11.4);
  line-height: 1.15;
  letter-spacing: .08em;
}

.head p {
  margin-top: 8px;
  font-family: var(--f-wei);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .34em;
  text-indent: .34em;
  color: var(--gold-a);
}

.reveal {
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 八道灵符 ---------- */

.fus {
  padding-top: calc(var(--vw) * 20);
}

.rail {
  --card-w: calc(var(--vw) * 82);
  --fu-h: calc(var(--vw) * 116);
  position: relative;
  display: flex;
  gap: 14px;
  margin-top: 26px;
  padding: 10px calc((min(100vw, 480px) - var(--card-w)) / 2) 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.card {
  position: relative;
  flex: 0 0 var(--card-w);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  padding: 19px 17px 19px 19px;
  border: 1px solid var(--gold-b);
  border-radius: 3px;
  background:
    radial-gradient(120% 60% at 0 0, rgba(214, 58, 42, .11), transparent 60%),
    linear-gradient(180deg, #1a1411, #110d0b);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .45);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--gold-c);
  border-radius: 2px;
  pointer-events: none;
}

.js .card:not(.is-active) {
  opacity: .42;
  transform: scale(.955);
}

.card-fu {
  position: relative;
  align-self: start;
  line-height: 0;
}

.card-fu img {
  width: auto;
  height: var(--fu-h);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .6);
  transition: filter 1s;
}

.card-duty {
  position: absolute;
  top: -7px;
  left: -7px;
  display: none;
  writing-mode: vertical-rl;
  padding: 8px 4px 7px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
  color: #3a2408;
  font-family: var(--f-wei);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .16em;
}

.card.is-duty .card-duty {
  display: block;
}

.card-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-script {
  writing-mode: vertical-rl;
  align-self: flex-end;
  height: calc(var(--vw) * 52);
}

.card-ord {
  margin-left: 7px;
  font-family: var(--f-wei);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: .34em;
  color: var(--red);
}

.card-name {
  margin-left: 9px;
  padding: .04em 0;
  font-family: var(--f-brush);
  font-size: calc(var(--vw) * 11.6);
  line-height: 1.14;
  letter-spacing: .04em;
}

.card-lines {
  font-size: 14px;
  line-height: 1.72;
  letter-spacing: .2em;
  color: var(--cream-a);
}

.card-lines span {
  display: block;
}

.card-lines span:first-child {
  color: var(--gold);
}

.card-text {
  margin-top: auto;
  padding-top: 16px;
}

.card-lord {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-wei);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .16em;
  color: var(--gold-a);
  white-space: nowrap;
}

.card-lord i {
  flex: 1;
  height: 1px;
  background: var(--gold-c);
}

.card-lord i:first-child {
  flex: 0 0 10px;
}

.card-bless {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: var(--cream);
  text-align: justify;
}

.card-paper {
  margin-top: 12px;
  font-family: var(--f-wei);
  font-size: 11px;
  line-height: 1;
  letter-spacing: .14em;
  color: var(--cream-b);
  white-space: nowrap;
}

.card-paper i {
  margin: 0 .55em;
}

.pips {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 2px;
}

.pip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 40px;
}

.pip i {
  width: 6px;
  height: 18px;
  border: 1px solid var(--gold-b);
  transition: height .4s var(--ease), background .4s, border-color .4s, box-shadow .4s;
}

.pip.is-duty i {
  border-color: var(--gold-hi);
}

.pip.is-active i {
  height: 28px;
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 12px rgba(214, 58, 42, .8);
}

/* ---------- 三月之期 ---------- */

.term {
  padding-top: calc(var(--vw) * 22);
}

.term-body {
  display: grid;
  grid-template-columns: calc(var(--vw) * 20) minmax(0, 1fr);
  gap: calc(var(--vw) * 3);
  align-items: center;
  margin-top: 18px;
  padding: 0 var(--pad);
}

.censer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 84px;
  color: var(--gold);
}

.incense {
  --left: 1;
  position: relative;
  width: 100%;
  height: calc(var(--vw) * 56);
}

.incense-ghost {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed rgba(220, 180, 104, .34);
}

.incense-stick {
  position: absolute;
  bottom: -9px;
  left: 50%;
  width: 5px;
  height: calc(var(--left) * 100% + 9px);
  margin-left: -2.5px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, #56281a, #b55a32 45%, #6a3320);
  box-shadow: 0 0 10px rgba(0, 0, 0, .6);
}

.incense-stick::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 9px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(#d8d2c8, #7b746b);
}

.incense-ember {
  position: absolute;
  bottom: calc(var(--left) * 100% - 3px);
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #ffc27a;
  box-shadow: 0 0 6px 2px #ff7a2e, 0 0 20px 7px rgba(255, 98, 36, .55);
  animation: ember 2.4s ease-in-out infinite;
}

@keyframes ember {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: .72;
    transform: scale(.82);
  }
}

.smoke {
  position: absolute;
  bottom: calc(var(--left) * 100% + 4px);
  left: 50%;
  width: 9px;
  height: 30px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: rgba(241, 232, 213, .6);
  filter: blur(5px);
  opacity: 0;
  animation: smoke 5.4s ease-out infinite;
}

.smoke-1 {
  --dx: 12px;
}

.smoke-2 {
  --dx: -9px;
  animation-delay: -1.8s;
}

.smoke-3 {
  --dx: 5px;
  animation-delay: -3.6s;
}

@keyframes smoke {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(.5);
  }
  14% {
    opacity: .55;
  }
  60% {
    opacity: .22;
    transform: translate(calc(var(--dx) * -.6), -48px) scale(1.7);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), -86px) scale(2.8);
  }
}

.mark {
  position: absolute;
  left: calc(50% + 15px);
  font-family: var(--f-wei);
  font-size: 12px;
  line-height: 1;
  color: var(--gold-a);
}

.mark::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 4px);
  width: 7px;
  height: 1px;
  background: var(--gold-a);
}

.mark-start {
  top: -6px;
}

.mark-end {
  bottom: -6px;
}

.censer-pot {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 92px;
  height: auto;
  margin-top: 2px;
}

.count {
  padding-top: 40px;
}

.count-label {
  font-family: var(--f-wei);
  font-size: 13px;
  line-height: 1;
  letter-spacing: .5em;
  color: var(--gold-a);
}

.count-days {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 6px;
  white-space: nowrap;
}

.count-days b {
  padding: .06em .04em .08em 0;
  font-family: var(--f-brush);
  font-size: calc(var(--vw) * 21);
  line-height: 1;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .5));
}

.count-days b[data-len="3"] {
  font-size: calc(var(--vw) * 17.6);
}

.count-days b[data-len="4"] {
  font-size: calc(var(--vw) * 14);
}

.count-days i {
  padding-bottom: .85em;
  font-family: var(--f-wei);
  font-size: 20px;
  line-height: 1;
  color: var(--gold);
}

.count-hms {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.count-hms span {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 9px 0 8px;
  border: 1px solid var(--gold-c);
  border-radius: 2px;
  background: rgba(220, 180, 104, .045);
}

.count-hms b {
  font-family: var(--f-wei);
  font-size: calc(var(--vw) * 5.4);
  line-height: 1.1;
  color: var(--gold-hi);
  white-space: nowrap;
}

.count-hms i {
  font-family: var(--f-wei);
  font-size: 11px;
  line-height: 1;
  color: var(--gold-a);
}

.count-note {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: .04em;
  color: var(--cream-b);
}

.dates {
  margin: 30px var(--pad) 0;
  border-top: 1px solid var(--gold-b);
}

.dates > div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--gold-c);
}

.dates > div:last-child {
  border-bottom-color: var(--gold-b);
}

.dates dt {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  background: linear-gradient(150deg, #e2452f, var(--red-deep));
  color: #fdeedd;
  font-family: var(--f-wei);
  font-size: 15px;
  line-height: 1;
  filter: url(#rough);
}

.dates dd {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
  font-family: var(--f-wei);
  line-height: 1.3;
}

.dates dd b {
  font-size: 16px;
  letter-spacing: .06em;
  color: var(--cream);
  white-space: nowrap;
}

.dates dd span {
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--gold-a);
  white-space: nowrap;
}

/* ---------- 受符 ---------- */

.bless {
  padding-top: calc(var(--vw) * 24);
  text-align: center;
}

.bless-copy {
  margin-top: 22px;
  padding: 0 var(--pad);
  font-size: 15.5px;
  line-height: 2.05;
  letter-spacing: .1em;
  color: var(--cream-a);
}

.seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.seal-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--vw) * 66);
  height: calc(var(--vw) * 66);
  border-radius: 50%;
}

.seal-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .78;
  animation: turn 90s linear infinite;
  transition: opacity 1s;
}

.seal-core {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #f0553c, var(--red) 46%, var(--red-deep));
  box-shadow: 0 0 0 5px var(--ink), 0 0 0 6px var(--gold-b), 0 0 34px 6px rgba(214, 58, 42, .5);
  transition: transform .3s var(--ease);
  animation: pulse 2.8s ease-in-out infinite;
}

.seal-core b {
  color: #fdeedd;
  font-family: var(--f-brush);
  font-size: calc(var(--vw) * 15);
  line-height: 1;
  text-shadow: 0 2px 6px rgba(90, 10, 4, .7);
  filter: url(#rough);
}

.seal-btn:active .seal-core {
  transform: scale(.93);
}

.seal-btn.is-pressed .seal-core {
  animation: press .7s var(--ease);
}

.seal-btn.is-pressed .seal-ring {
  opacity: 1;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px var(--ink), 0 0 0 6px var(--gold-b), 0 0 26px 4px rgba(214, 58, 42, .42);
  }
  50% {
    box-shadow: 0 0 0 5px var(--ink), 0 0 0 6px var(--gold-a), 0 0 46px 12px rgba(214, 58, 42, .62);
  }
}

@keyframes press {
  0% {
    transform: scale(1);
  }
  22% {
    transform: scale(.86);
  }
  55% {
    transform: scale(1.1);
    box-shadow: 0 0 0 5px var(--ink), 0 0 0 6px var(--gold-hi), 0 0 90px 30px rgba(248, 210, 130, .7);
  }
  100% {
    transform: scale(1);
  }
}

.seal-hint {
  margin-top: -6px;
  font-family: var(--f-wei);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .34em;
  text-indent: .34em;
  color: var(--gold);
}

.vows {
  display: flex;
  justify-content: center;
  gap: calc(var(--vw) * 2);
  margin-top: 26px;
  padding: 0 var(--pad);
}

.vows li {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  width: calc(var(--vw) * 8);
  height: calc(var(--vw) * 17);
  border: 1px solid var(--gold-c);
  color: var(--cream-b);
  font-family: var(--f-wei);
  font-size: 13px;
  line-height: 1;
  letter-spacing: .22em;
  transition: background .6s var(--ease), color .6s, border-color .6s, box-shadow .6s, transform .6s var(--ease);
}

.vows li.is-on {
  border-color: rgba(248, 231, 182, .7);
  background: linear-gradient(170deg, #e2452f, var(--red-deep));
  box-shadow: 0 0 16px rgba(214, 58, 42, .55);
  color: #fdeedd;
  transform: translateY(-4px);
}

.vows li:first-child.is-on {
  background: linear-gradient(170deg, #f6cf62, #d9a233);
  box-shadow: 0 0 16px rgba(240, 196, 90, .5);
  color: #4a2a06;
}

/* 受符之前，这一段不占高度。 */
.bless-done {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0 var(--pad);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .08em;
  color: var(--cream);
  opacity: 0;
  transition: grid-template-rows .9s var(--ease), opacity 1.1s var(--ease) .2s;
}

.bless-done > div {
  min-height: 0;
  overflow: hidden;
}

.bless-done p {
  padding-top: 24px;
}

.bless-done.is-on {
  grid-template-rows: 1fr;
  opacity: 1;
}

.bless-done b {
  display: block;
  margin-bottom: 4px;
  font-family: var(--f-wei);
  font-size: 13px;
  letter-spacing: .26em;
  text-indent: .26em;
  color: var(--gold);
}

.photo {
  margin-top: calc(var(--vw) * 12);
}

.photo-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-top: 1px solid var(--gold-b);
  border-bottom: 1px solid var(--gold-b);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.photo-scroll::-webkit-scrollbar {
  display: none;
}

.photo-scroll img {
  width: auto;
  height: calc(var(--vw) * 60);
}

.photo figcaption {
  margin-top: 14px;
  font-family: var(--f-wei);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--cream-b);
}

/* ---------- 页脚 ---------- */

.foot {
  padding: calc(var(--vw) * 20) 0 calc(env(safe-area-inset-bottom, 0px) + 44px);
  text-align: center;
}

.foot-main {
  position: relative;
  z-index: 1;
  font-family: var(--f-brush);
  font-size: calc(var(--vw) * 13);
  line-height: 1.2;
  letter-spacing: .3em;
  text-indent: .3em;
}

.foot-sub {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 13.5px;
  letter-spacing: .14em;
  color: var(--cream-a);
}

.foot-note {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  font-family: var(--f-wei);
  font-size: 12px;
  letter-spacing: .5em;
  text-indent: .5em;
  color: var(--gold-a);
}

.lotus-foot {
  position: relative;
  left: -10%;
  width: 120%;
  margin-top: calc(var(--vw) * -8);
  border: 0;
  opacity: .5;
  -webkit-mask-image: linear-gradient(transparent, #000 55%);
  mask-image: linear-gradient(transparent, #000 55%);
}

.lotus-foot img {
  top: 0;
}

/* ---------- 大图 ---------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 5, 4, .93);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade .35s var(--ease) both;
}

.viewer[hidden] {
  display: none;
}

.viewer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.viewer-inner img {
  width: auto;
  max-width: 78vw;
  height: 76vh;
  height: 76svh;
  object-fit: contain;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, .8)) drop-shadow(0 0 40px rgba(214, 58, 42, .25));
  animation: rise .5s var(--ease) both;
}

.viewer-name {
  margin-top: 16px;
  font-family: var(--f-wei);
  font-size: 14px;
  line-height: 1;
  letter-spacing: .28em;
  color: var(--gold-hi);
  white-space: nowrap;
}

.viewer-close {
  margin-top: 16px;
  padding: 10px 28px;
  border: 1px solid var(--gold-b);
  border-radius: 999px;
  font-family: var(--f-wei);
  font-size: 13px;
  line-height: 1;
  letter-spacing: .4em;
  text-indent: .4em;
  color: var(--gold);
}

/* ---------- 符期已满 ---------- */

[data-state="expired"] .paper img,
[data-state="expired"] .card-fu img {
  filter: saturate(.45) brightness(.72);
}

[data-state="expired"] .chip-dot,
[data-state="expired"] .incense-ember,
[data-state="expired"] .smoke,
[data-state="expired"] .count-hms {
  display: none;
}

[data-state="expired"] .seal-core {
  animation: none;
  filter: saturate(.5) brightness(.8);
}

/* ---------- 矮屏幕 ---------- */

@media (max-height: 700px) {
  .title {
    margin-top: 18px;
  }

  .down {
    display: none;
  }
}

/* ---------- 减少动效 ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .smoke {
    display: none;
  }
}
