/* ============================================================
 * 《赫利恩·未归档》 pollution.css —— 网页污染（PHASE 13「掉 SAN」增强版）
 * 行为驱动，静默渐进，不可逆。0-4 级由存档线索实时计算，5 级保留扩展。
 * 冲击层全部走 body::before/::after 全屏 fixed 伪元素：
 *   ::before = 噪点/信号故障层；::after = 血渍 + 渗血 + 四角漏光 + 红闪。
 * 纯 CSS 内联 SVG data-URI，file:// 零网络请求。
 * ============================================================ */

:root {
  /* 泼溅血渍 A：鲜红主斑 + 卫星滴 + 拖尾 */
  --blood-a: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20240%20240'%3E%3Cg%20fill='%237a1010'%3E%3Cellipse%20cx='110'%20cy='120'%20rx='62'%20ry='48'%20opacity='.92'/%3E%3Cellipse%20cx='52'%20cy='86'%20rx='20'%20ry='14'%20opacity='.8'/%3E%3Cellipse%20cx='178'%20cy='74'%20rx='14'%20ry='11'%20opacity='.7'/%3E%3Cellipse%20cx='186'%20cy='160'%20rx='17'%20ry='12'%20opacity='.75'/%3E%3Cellipse%20cx='60'%20cy='168'%20rx='11'%20ry='9'%20opacity='.65'/%3E%3Ccircle%20cx='160'%20cy='130'%20r='4'%20opacity='.7'/%3E%3Ccircle%20cx='70'%20cy='120'%20r='5'%20opacity='.75'/%3E%3Ccircle%20cx='140'%20cy='46'%20r='3'%20opacity='.6'/%3E%3Ccircle%20cx='100'%20cy='180'%20r='3.5'%20opacity='.6'/%3E%3Ccircle%20cx='205'%20cy='105'%20r='3'%20opacity='.55'/%3E%3Ccircle%20cx='40'%20cy='55'%20r='2.5'%20opacity='.55'/%3E%3C/g%3E%3Cg%20stroke='%238d1212'%20fill='none'%20opacity='.55'%3E%3Cpath%20d='M110%20120%20C150%20140%20175%20155%20200%20165'%20stroke-width='6'%20stroke-linecap='round'/%3E%3Cpath%20d='M110%20120%20C90%20100%2075%2085%2055%2068'%20stroke-width='4'%20stroke-linecap='round'/%3E%3Cpath%20d='M96%20132%20C88%20150%2082%20162%2078%20178'%20stroke-width='4'%20stroke-linecap='round'%20stroke-dasharray='1%207'/%3E%3C/g%3E%3C/svg%3E");
  /* 泼溅血渍 B：暗褐干血块 + 拖尾 */
  --blood-b: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20240%20240'%3E%3Cg%20fill='%23530d0d'%3E%3Cellipse%20cx='120'%20cy='110'%20rx='70'%20ry='52'%20opacity='.9'/%3E%3Cellipse%20cx='52'%20cy='140'%20rx='18'%20ry='13'%20opacity='.75'/%3E%3Cellipse%20cx='190'%20cy='130'%20rx='16'%20ry='11'%20opacity='.7'/%3E%3Cellipse%20cx='140'%20cy='190'%20rx='13'%20ry='10'%20opacity='.65'/%3E%3Ccircle%20cx='80'%20cy='80'%20r='4'%20opacity='.7'/%3E%3Ccircle%20cx='170'%20cy='60'%20r='3'%20opacity='.6'/%3E%3Ccircle%20cx='30'%20cy='100'%20r='2.5'%20opacity='.55'/%3E%3C/g%3E%3Cg%20stroke='%23590d0d'%20fill='none'%20opacity='.5'%3E%3Cpath%20d='M120%20110%20C150%20130%20170%20150%20185%20175'%20stroke-width='6'%20stroke-linecap='round'/%3E%3Cpath%20d='M100%20130%20C85%20150%2072%20170%2060%20190'%20stroke-width='4'%20stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- 通用（污染 >0 即有体感） ---------- */
body[data-pollution="1"],
body[data-pollution="2"],
body[data-pollution="3"],
body[data-pollution="4"],
body[data-pollution="5"] {
  position: relative;
  min-height: 100vh;
}

body[data-pollution="1"]::before,
body[data-pollution="2"]::before,
body[data-pollution="3"]::before,
body[data-pollution="4"]::before,
body[data-pollution="5"]::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-repeat: repeat;
  background-size: 260px 260px;
  opacity: 0;
  transition: opacity 1.2s ease;
}

body[data-pollution="1"]::after,
body[data-pollution="2"]::after,
body[data-pollution="3"]::after,
body[data-pollution="4"]::after,
body[data-pollution="5"]::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-repeat: no-repeat;
  transition: opacity 1.2s ease;
  opacity: 0;
}

/* ===== L1：暗角渐深 + Logo 变形（轻度：还只是"不对劲"） ===== */
body[data-pollution="1"]::after {
  opacity: 1;
  background-image:
    radial-gradient(ellipse 90% 70% at 50% 45%, rgba(0,0,0,0) 52%, rgba(26,2,2,.16) 78%, rgba(20,0,0,.38) 100%);
}

/* ===== L2：第一处血渍爬上线头 + 整体开始变味 ===== */
body[data-pollution="2"]::after {
  opacity: 1;
  background-image:
    var(--blood-a),
    radial-gradient(ellipse 100% 80% at 50% 40%, rgba(0,0,0,0) 48%, rgba(24,2,2,.22) 82%, rgba(16,0,0,.44) 100%);
  background-position: right -38px top -50px, center;
  background-size: 340px 340px, 100% 100%;
  mix-blend-mode: multiply;
}

/* ===== L3：血渍多处 + 噪点浮现 + 页面暗红得像在发烧 ===== */
body[data-pollution="3"] {
  background: #ded5c6;
}
body[data-pollution="3"]::before {
  opacity: .05;
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='260'%20height='260'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.85'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='260'%20height='260'%20filter='url(%23n)'/%3E%3C/svg%3E");
}
body[data-pollution="3"]::after {
  opacity: 1;
  background-image:
    var(--blood-a),
    var(--blood-b),
    radial-gradient(ellipse 120% 90% at 50% 40%, rgba(0,0,0,0) 40%, rgba(30,2,2,.26) 78%, rgba(14,0,0,.5) 100%);
  background-position: right -38px top -50px, left -46px bottom -58px, center;
  background-size: 340px 340px, 300px 300px, 100% 100%;
  mix-blend-mode: multiply;
  animation: p-bleed 1.1s ease-in 1;
}

body[data-pollution="3"] .site-hero { filter: sepia(.2) saturate(.78) contrast(.96) brightness(.96); }
body[data-pollution="3"] h1, body[data-pollution="3"] h2 { text-shadow: 0 0 1px rgba(90, 8, 8, .55); }

/* ===== L4：全屏失控——噪点抖动 + 四角漏红 + 顶部渗血 + 入场红闪 + 首页之门 ===== */
body[data-pollution="4"]::before {
  opacity: .09;
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='260'%20height='260'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.85'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='260'%20height='260'%20filter='url(%23n)'/%3E%3C/svg%3E");
  animation: p-noise 2.6s steps(6) 2, p-settle 8s ease-out 1 both;
}
body[data-pollution="4"]::after {
  opacity: 1;
  background-image:
    var(--blood-a),
    var(--blood-b),
    linear-gradient(180deg, rgba(133,12,12,.42) 0%, rgba(133,12,12,.14) 11%, rgba(133,12,12,0) 24%),
    radial-gradient(ellipse 100% 80% at 0% 0%, rgba(190,10,10,.26) 0%, rgba(190,10,10,0) 42%),
    radial-gradient(ellipse 100% 80% at 100% 0%, rgba(190,10,10,.22) 0%, rgba(190,10,10,0) 40%),
    radial-gradient(ellipse 100% 80% at 0% 100%, rgba(170,8,8,.24) 0%, rgba(170,8,8,0) 46%),
    radial-gradient(ellipse 100% 80% at 100% 100%, rgba(170,8,8,.20) 0%, rgba(170,8,8,0) 44%),
    radial-gradient(ellipse 130% 100% at 50% 40%, rgba(0,0,0,0) 34%, rgba(26,2,2,.3) 74%, rgba(10,0,0,.56) 100%);
  background-position:
    right -38px top -50px,
    left -46px bottom -58px,
    0 0,
    0 0, 0 0, 0 0, 0 0, 0 0;
  background-size: 340px 340px, 300px 300px, 100% 35%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  mix-blend-mode: multiply;
  animation: p-burst 9s ease-out 1 both;
}
body[data-pollution="4"] { animation: p-shake 2.4s 2; }

body[data-pollution="4"] .site-hero { filter: sepia(.3) saturate(.65) contrast(.94) brightness(.9); }
body[data-pollution="4"] .news-item h3,
body[data-pollution="4"] .site-section h2 { animation: p-flick 3.7s 1; }

/* ===== L5：终局（保留扩展）——全屏腥红 ===== */
body[data-pollution="5"]::before { opacity: .12; background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='260'%20height='260'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.85'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='260'%20height='260'%20filter='url(%23n)'/%3E%3C/svg%3E"); animation: p-noise .5s steps(7) infinite; }
body[data-pollution="5"]::after { opacity: 1; background-color: rgba(84, 4, 4, .18); mix-blend-mode: multiply; animation: p-flash .5s ease-out 1; }

/* ---------- 污染①：Logo 变形 ---------- */
.site-brand.logo-warp .site-logo-svg {
  transform: rotate(7deg) skewX(3deg) scale(1.04);
  transition: transform .6s ease;
}
body[data-pollution="3"] .site-brand.logo-warp .site-logo-svg,
body[data-pollution="4"] .site-brand.logo-warp .site-logo-svg,
body[data-pollution="5"] .site-brand.logo-warp .site-logo-svg {
  transform: rotate(9deg) skewX(5deg) scale(1.06);
  filter: saturate(.6) hue-rotate(-18deg);
}

/* ---------- 污染④：首页变为赫利恩的门（底部沉入黑暗） ---------- */
.site-hero-door { position: relative; padding: 0 !important; overflow: hidden; }
.site-hero-door .site-inner { padding: 3.4rem 0; }
.site-hero-door-img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  opacity: .82;
  filter: sepia(.2) saturate(.72) contrast(1.06) brightness(.88);
}
.site-hero-door::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(8,1,1,0) 55%, rgba(8,1,1,.5) 100%),
              radial-gradient(60% 50% at 50% 45%, rgba(0,0,0,0) 50%, rgba(20,2,2,.35) 100%);
}
.site-hero-door h1 {
  position: relative;
  z-index: 1;
  margin-top: .4rem;
  font-size: 2.6rem;
  letter-spacing: .3em;
  color: #e8ded0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .75), 0 0 26px rgba(120, 10, 10, .3);
  animation: p-flick 4.2s 1;
}

/* ---------- 动画 ---------- */
/* L4 阶段化：入场红闪+渗血 → 9 秒内收敛为轻度持续（fill both 保持终态） */
@keyframes p-burst {
  0%   { opacity: 0; }
  6%   { opacity: .95; }
  10%  { opacity: .55; }
  14%  { opacity: .92; }
  22%  { opacity: .55; }
  34%  { opacity: .38; }
  55%  { opacity: .3; }
  100% { opacity: .28; }
}
/* 噪点静息 */
@keyframes p-settle {
  0%   { opacity: .09; }
  60%  { opacity: .06; }
  100% { opacity: .02; }
}
@keyframes p-bleed {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes p-flash {
  0%   { opacity: 0; }
  18%  { opacity: .95; }
  34%  { opacity: .25; }
  48%  { opacity: .8; }
  70%  { opacity: .3; }
  100% { opacity: 1; }
}
@keyframes p-noise {
  0%   { background-position: 0 0; }
  16%  { background-position: -24px 12px; }
  33%  { background-position: 18px -30px; }
  50%  { background-position: -32px -18px; }
  66%  { background-position: 26px 22px; }
  83%  { background-position: -14px 30px; }
  100% { background-position: 0 0; }
}
@keyframes p-shake {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-.5px, .4px); }
  25% { transform: translate(.6px, -.5px); }
  37% { transform: translate(-.4px, -.3px); }
  50% { transform: translate(.5px, .5px); }
  63% { transform: translate(-.6px, .2px); }
  75% { transform: translate(.3px, -.6px); }
  87% { transform: translate(-.3px, .4px); }
}
@keyframes p-flick {
  0%, 100% { opacity: 1; }
  88% { opacity: 1; }
  91% { opacity: .72; }
  93% { opacity: 1; }
  96% { opacity: .85; }
}

/* 系统开启"减少动态"时收敛动画（可访问性） */
@media (prefers-reduced-motion: reduce) {
  body[data-pollution]::before,
  body[data-pollution]::after,
  body[data-pollution="4"],
  body[data-pollution="4"] .news-item h3,
  body[data-pollution="4"] .site-section h2,
  .site-hero-door h1 {
    animation: none !important;
  }
}
