/* ============================================================
   anim.css —— 全是"纸和墨怎么动"，不许弹、不许转、不许反光
   ============================================================ */

/* ---------- 正文逐行出现 ---------- */
@keyframes lineIn {
  from { opacity: 0; transform: translateY(4px); filter: blur(.4px); }
  to   { opacity: 1; transform: none;            filter: none; }
}
.line.in { animation: lineIn .42s var(--ease) both; }

/* ---------- 选项出现 ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.choices.show .choice { animation: rise .34s var(--ease) both; }
.choices.show .choice:nth-child(2) { animation-delay: .06s; }
.choices.show .choice:nth-child(3) { animation-delay: .12s; }
.choices.show .choice:nth-child(4) { animation-delay: .18s; }
.choices.show .choice:nth-child(5) { animation-delay: .24s; }

/* ---------- 页面上墨 ---------- */
@keyframes inkOn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.page.on { animation: inkOn .55s var(--ease) both; }

/* ---------- 墨点扩散 ---------- */
.ink-blot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,40,38,.30) 0%, rgba(37,40,38,.12) 45%, rgba(37,40,38,0) 72%);
  pointer-events: none;
  transform: scale(0);
  animation: blot 1600ms ease-out forwards;
  mix-blend-mode: multiply;
}
@keyframes blot {
  0%   { transform: scale(.15); opacity: .9; }
  60%  { transform: scale(1);   opacity: .5; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ---------- 闪白（只在最关键的一下，极力少用） ---------- */
.flash-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.flash-layer.go { animation: flash 420ms ease-out forwards; }
@keyframes flash {
  0%   { background: rgba(252,250,243,.0); }
  18%  { background: rgba(252,250,243,.55); }
  100% { background: rgba(252,250,243,0); }
}

/* ---------- 印章 ---------- */
.stamp-mark {
  position: absolute;
  pointer-events: none;
  display: grid; place-items: center;
  font-family: var(--font-kai);
  color: var(--zh);
  border: 2px solid var(--zh);
  opacity: 0;
  mix-blend-mode: multiply;
  animation: stampDown 620ms cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes stampDown {
  0%   { opacity: 0; transform: scale(1.5) rotate(-4deg); }
  38%  { opacity: .92; transform: scale(.96) rotate(-2deg); }
  52%  { opacity: .84; transform: scale(1) rotate(-2deg); }
  100% { opacity: .72; transform: scale(1) rotate(-2deg); }
}
.stamp-mark.sq { width: 60px; height: 60px; font-size: 34px; border-radius: 2px; }
.stamp-mark.rd { width: 50px; height: 50px; font-size: 22px; border-radius: 50%; }

/* 章盖下去之后，纸面留一圈淡红 */
.stamp-mark::after {
  content: '';
  position: absolute; inset: -3px;
  border: 1px solid rgba(185,74,61,.28);
  border-radius: inherit;
}
.stamp-mark.sq, .stamp-mark.rd { right: 30px; bottom: 38px; }
.stamp-mark.dry { transition: opacity 2s ease-out; opacity: .62; }

/* ---------- 茶杯递过来 ---------- */
@keyframes cupIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: none; }
}
.cup-in { animation: cupIn .7s var(--ease) both; }

/* ---------- 档案袋打开 ---------- */
@keyframes bagOpen {
  0%   { transform: translateY(0) scale(1); }
  55%  { transform: translateY(-6px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}
.bag.open { animation: bagOpen .68s var(--ease); }

/* ---------- 公文展开 ---------- */
@keyframes docUnfold {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; clip-path: inset(0 0 0 0); }
}
.doc-paper.unfold { animation: docUnfold .5s var(--ease) both; }

/* ---------- 数字滚动时的抖动抑制 ---------- */
.num-settle { transition: opacity .2s; }

/* ---------- 心跳：屏幕边缘轻轻收一下 ---------- */
@keyframes pulseEdge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185,74,61,0); }
  40%      { box-shadow: 0 0 0 3px rgba(185,74,61,.10); }
}
.beat { animation: pulseEdge 900ms ease-in-out 2; }

/* ---------- 呼吸：环境微动，周期 ≥5s，幅度 ≤5px ---------- */
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.breathe { animation: breathe 7s ease-in-out infinite; }

/* ---------- 提示条 ---------- */
.toast-wrap {
  position: fixed; left: 0; right: 0; bottom: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 120; pointer-events: none;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.toast {
  max-width: min(560px, calc(100vw - 40px));
  padding: 12px 22px;
  background: rgba(37,40,38,.94);
  color: #F2EEE5;
  font-size: 14px;
  letter-spacing: .06em;
  line-height: 1.7;
  border-radius: 2px;
  animation: toastIn .3s var(--ease) both;
}
.toast.out {
  opacity: 0; transform: translateY(6px);
  animation: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.toast.warn { background: rgba(185,74,61,.94); }

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, .line.in, .page.on, .choices.show .choice, .stamp-mark, .ink-blot, .flash-layer.go {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 通用隐藏：靠 class 而不是 hidden 属性，免得被 display 规则顶掉 */
.off { display: none !important; }
