/* ==========================================================================
   ANIME DECO — 动漫要素层（贴纸 / 拟声词 / 网点 / 气泡 / 印章）
   用法：<div class="an-deco" data-deco="hero">…</div>
   每个要素都是纯 CSS/SVG，无外链
   ========================================================================== */

.an-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
  color: #fff;
}

.an-deco > * {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(var(--s, 1));
  transform-origin: center;
}

/* ---------- 星星 / 闪片 ---------- */
.an-star {
  width: 18px;
  height: 18px;
  background: currentColor;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: var(--o, .85);
  filter: drop-shadow(0 0 6px rgba(255, 220, 200, .55));
}
.an-star--sparkles {
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
}

/* ---------- 心 ---------- */
.an-heart {
  width: 16px;
  height: 16px;
  background: currentColor;
  clip-path: path("M8 15C3 11 0 8.4 0 5.3 0 2.4 2.2 0 5 0c1.4 0 2.6.7 3 1.6C8.4.7 9.6 0 11 0c2.8 0 5 2.4 5 5.3 0 3.1-3 5.7-8 9.7z");
  opacity: var(--o, .9);
}

/* ---------- 拟声词 ---------- */
.an-sfx {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.6px currentColor;
  text-stroke: 1.6px currentColor;
  opacity: var(--o, .7);
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-shadow: 2px 3px 0 rgba(20, 12, 30, .35);
}
.an-sfx--solid {
  color: currentColor;
  -webkit-text-stroke: 0;
}

/* ---------- 网点 ---------- */
.an-tone {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background-image: radial-gradient(currentColor 1.15px, transparent 1.3px);
  background-size: 7px 7px;
  opacity: var(--o, .3);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 46%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 46%, transparent 72%);
}

/* ---------- 胶带 ---------- */
.an-tape {
  width: 74px;
  height: 22px;
  background: rgba(255, 246, 224, .42);
  border-left: 1px dashed rgba(255, 255, 255, .35);
  border-right: 1px dashed rgba(255, 255, 255, .35);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
  backdrop-filter: blur(1px);
}

/* ---------- 对话气泡 ---------- */
.an-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 9px 13px;
  border-radius: 14px;
  background: #fffdf7;
  color: #2a2136;
  font-family: var(--vn-sans, system-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  box-shadow: 0 6px 16px rgba(10, 6, 20, .3);
}
.an-bubble::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 0 0 3px 0;
}
.an-bubble--right::after {
  left: auto;
  right: 14px;
  border-radius: 0 0 0 3px;
}

/* ---------- 圆形印章 ---------- */
.an-stamp {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1.6px solid currentColor;
  display: grid;
  place-items: center;
  font-family: var(--vn-serif, serif);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-align: center;
  line-height: 1.3;
  opacity: var(--o, .62);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .06);
}

/* ---------- 手绘箭头 ---------- */
.an-arrow {
  width: 62px;
  height: 40px;
  opacity: var(--o, .55);
}
.an-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* ---------- 面板框 + 裁切标记 ---------- */
.an-frame {
  width: 128px;
  height: 76px;
  border: 1px solid rgba(255, 255, 255, .35);
  opacity: var(--o, .5);
}
.an-frame::before,
.an-frame::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, .55);
}
.an-frame::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.an-frame::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }

/* ---------- 速度线迸发 ---------- */
.an-burst {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, .5) 0deg 1.6deg,
    transparent 1.6deg 9deg
  );
  -webkit-mask-image: radial-gradient(circle, transparent 34%, #000 62%);
  mask-image: radial-gradient(circle, transparent 34%, #000 62%);
  opacity: var(--o, .3);
}

/* ---------- 小花瓣（简笔） ---------- */
.an-petal {
  width: 12px;
  height: 12px;
  background: currentColor;
  border-radius: 60% 10% 60% 10%;
  opacity: var(--o, .8);
}

/* ---------- 音符 ---------- */
.an-note {
  font-size: 16px;
  opacity: var(--o, .75);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .35));
}

/* ---------- 竖排小字标签 ---------- */
.an-label {
  writing-mode: vertical-rl;
  font-family: var(--vn-serif, serif);
  font-size: 10px;
  letter-spacing: .32em;
  opacity: var(--o, .55);
  padding: 4px 2px;
  border-left: 1px solid currentColor;
}

/* ---------- 拍立得小相框（要素，不含照片） ---------- */
.an-polaroid {
  width: 54px;
  height: 66px;
  background: rgba(255, 253, 247, .88);
  border-radius: 2px;
  box-shadow: 0 6px 16px rgba(8, 4, 16, .35);
  transform: translate(-50%, -50%) rotate(var(--r, -6deg));
}
.an-polaroid::after {
  content: "";
  position: absolute;
  inset: 5px 5px 16px 5px;
  background: linear-gradient(140deg, rgba(200, 160, 190, .55), rgba(120, 100, 150, .55));
}

/* ---------- 「!」「?」漫画符号 ---------- */
.an-mark {
  font-family: var(--vn-serif, serif);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 0 rgba(20, 12, 30, .5), 0 0 12px rgba(255, 200, 180, .5);
  opacity: var(--o, .85);
}

/* ---------- 夜间萤火 ---------- */
.an-firefly {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe7a8;
  box-shadow: 0 0 12px 3px rgba(255, 226, 150, .55);
  opacity: var(--o, .8);
}

/* ============================ 版面里的要素带 ============================ */
/* 让带要素的区块成为定位容器 */
.vn-scenes,
.vn-letter,
.vn-gallery,
.vn-promises {
  position: relative;
}

/* 深色区块里的要素用暖白，浅色区块用墨色 */
.vn-letter .an-deco,
.vn-gallery .an-deco {
  color: #3a2f47;
}

@media (max-width: 680px) {
  .an-deco > * {
    transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(calc(var(--s, 1) * .82));
  }
  .an-sfx { font-size: 20px !important; }
  .an-tone { width: 74px; height: 74px; }
}

@media (prefers-reduced-motion: no-preference) {
  .an-deco .an-firefly {
    animation: an-float 6s ease-in-out infinite alternate;
  }
  .an-deco .an-firefly:nth-child(2n) { animation-duration: 8s; animation-delay: -2s; }
  .an-deco .an-firefly:nth-child(3n) { animation-duration: 10s; animation-delay: -4s; }
}

@keyframes an-float {
  from { translate: 0 0; }
  to { translate: 0 -14px; }
}
