/* ============================================================
 * splash.css · 落地页开场（玄鸟展翼 · 金印落定）+ 圆形展开退场
 * 结构：#splash > canvas#splash-fx + .sp-stage(.sp-halo/.sp-seal/.sp-title/.sp-sub/.sp-line)
 * 模式：sp-full / sp-short / sp-brief / sp-none（由 splash.js 判定）
 * 兼容：@property 不支持时退化为整体淡出，不影响首屏揭示
 * ============================================================ */
@property --splash-r{
  syntax:"<length>";
  inherits:false;
  initial-value:0px;
}

#splash{
  --splash-r:0px;
  position:fixed;
  inset:0;
  z-index:2147483000;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:#04180F;
  -webkit-mask-image:radial-gradient(circle at 50% 45%,transparent var(--splash-r),#000 calc(var(--splash-r) + 2px));
  mask-image:radial-gradient(circle at 50% 45%,transparent var(--splash-r),#000 calc(var(--splash-r) + 2px));
  contain:strict;
  touch-action:none;
}
#splash::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at 50% 42%,rgba(18,121,90,.62) 0%,rgba(9,63,42,.9) 42%,#03120B 100%);
}
#splash::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
  background:radial-gradient(circle at 50% 44%,transparent 26%,rgba(0,0,0,.5) 100%);
}
#splash canvas{
  position:absolute;
  inset:0;
  z-index:1;
  width:100%;
  height:100%;
}
body.splash-lock{overflow:hidden}

.sp-stage{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  transform:translateY(-2vh);
  transition:transform .5s cubic-bezier(.4,0,.2,1),opacity .35s ease;
}

/* 金色光晕 + 缓慢自转的细环 */
.sp-halo{
  position:absolute;
  top:50%;
  left:50%;
  z-index:-1;
  width:min(88vw,440px);
  aspect-ratio:1;
  border-radius:50%;
  transform:translate(-50%,-50%);
  background:radial-gradient(circle,rgba(245,179,1,.26) 0%,rgba(19,140,102,.24) 38%,transparent 68%);
  animation:spHalo 1.8s ease-out .1s both;
}
.sp-halo::after{
  content:"";
  position:absolute;
  inset:9%;
  border-radius:50%;
  border:1px solid rgba(245,179,1,.42);
  border-color:rgba(245,179,1,.42) transparent rgba(245,179,1,.42) transparent;
  animation:spSpin 5s linear infinite;
}
@keyframes spHalo{
  from{opacity:0;transform:translate(-50%,-50%) scale(.72)}
  to{opacity:1;transform:translate(-50%,-50%) scale(1)}
}
@keyframes spSpin{to{transform:rotate(360deg)}}

/* 玄鸟 3D 翻转入场 */
.sp-seal{
  width:clamp(148px,40vw,208px);
  aspect-ratio:1;
  display:flex;
  align-items:center;
  justify-content:center;
  transform-style:preserve-3d;
  filter:drop-shadow(0 22px 46px rgba(0,0,0,.55)) drop-shadow(0 0 18px rgba(245,179,1,.22));
  animation:spFlip 1.15s cubic-bezier(.18,.82,.24,1) .32s both;
}
.sp-seal img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
@keyframes spFlip{
  0%{opacity:0;transform:perspective(900px) rotateY(150deg) scale(.72)}
  55%{opacity:1}
  78%{transform:perspective(900px) rotateY(-7deg) scale(1.03)}
  100%{opacity:1;transform:perspective(900px) rotateY(0) scale(1)}
}

/* 落定金环冲击波 */
.sp-stage::after{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:min(62vw,268px);
  aspect-ratio:1;
  border-radius:50%;
  border:2px solid rgba(245,179,1,.8);
  transform:translate(-50%,-50%) scale(.25);
  opacity:0;
  pointer-events:none;
  animation:spWave 1.1s ease-out 1.28s both;
}
@keyframes spWave{
  0%{opacity:.9;transform:translate(-50%,-50%) scale(.25)}
  100%{opacity:0;transform:translate(-50%,-50%) scale(2.2)}
}

/* 品牌字逐字浮现（金色渐变描边字） */
.sp-title{
  margin-top:clamp(18px,3.6vh,30px);
  display:flex;
  font-family:var(--font-display,"Noto Serif SC","Songti SC","STSong",serif);
  font-weight:900;
  font-size:clamp(36px,10.5vw,54px);
  line-height:1.1;
  letter-spacing:.14em;
  filter:drop-shadow(0 4px 14px rgba(245,179,1,.18));
}
.sp-title span{
  display:inline-block;
  opacity:0;
  transform:translateY(.55em);
  background:linear-gradient(180deg,#FFF9E8 0%,#F5B301 46%,#B57B00 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  animation:spChar .62s cubic-bezier(.18,.82,.24,1) calc(1.16s + var(--i) * .095s) both;
}
@keyframes spChar{to{opacity:1;transform:none}}

.sp-sub{
  margin-top:12px;
  font-family:var(--font-kai,"Ma Shan Zheng","Kaiti SC","STKaiti",cursive);
  font-size:clamp(12px,3.4vw,15px);
  color:rgba(255,255,255,.72);
  letter-spacing:.42em;
  text-indent:.42em;
  opacity:0;
  animation:spSub .8s ease 1.52s both;
}
@keyframes spSub{from{opacity:0;letter-spacing:.9em}to{opacity:1;letter-spacing:.42em}}

.sp-line{
  width:0;
  height:1px;
  margin-top:20px;
  background:linear-gradient(90deg,transparent,rgba(245,179,1,.95),transparent);
  animation:spLine .9s cubic-bezier(.2,.8,.2,1) 1.62s forwards;
}
@keyframes spLine{to{width:min(46vw,180px)}}

/* 精简模式：会话内二次进入 / 文章分享深链 */
.sp-brief .sp-stage::after,
.sp-short .sp-stage::after{display:none}
.sp-brief .sp-seal,
.sp-short .sp-seal{animation:spSealIn .55s cubic-bezier(.2,.8,.2,1) .05s both}
@keyframes spSealIn{
  from{opacity:0;transform:scale(.84)}
  to{opacity:1;transform:none}
}
.sp-brief .sp-title span,
.sp-short .sp-title span{animation-duration:.34s;animation-delay:calc(.22s + var(--i) * .05s)}
.sp-brief .sp-sub,
.sp-short .sp-sub{animation-delay:.4s;animation-duration:.4s}
.sp-brief .sp-line,
.sp-short .sp-line{animation-delay:.45s;animation-duration:.45s}
.sp-brief .sp-halo,
.sp-short .sp-halo{animation-duration:.7s;opacity:.7}

/* 退场：遮罩圆形向外展开，主内容轻推入 */
#splash.splash-out{
  --splash-r:900px;
  opacity:0;
  transition:--splash-r .62s cubic-bezier(.4,0,.2,1),opacity .3s ease .38s;
}
#splash.splash-out .sp-stage{
  opacity:0;
  transform:translateY(-6vh) scale(1.06);
}
body.splash-in #app{animation:spAppIn .55s cubic-bezier(.2,.8,.2,1)}
@keyframes spAppIn{
  from{opacity:.6;transform:scale(.986)}
  to{opacity:1;transform:none}
}

/* 降级：减少动态 / 兼容不支持 @property 的浏览器 */
.sp-reduce .sp-halo,
.sp-reduce .sp-stage::after{display:none}
.sp-reduce .sp-seal,
.sp-reduce .sp-title span,
.sp-reduce .sp-sub,
.sp-reduce .sp-line{animation:none;opacity:1;transform:none;width:auto}
#splash.sp-reduce{transition:opacity .3s ease}

@media (prefers-reduced-motion:reduce){
  .sp-halo,
  .sp-stage::after{display:none}
  .sp-seal,
  .sp-title span,
  .sp-sub,
  .sp-line{animation-duration:.01s;animation-delay:0s}
}

/* 低高度视口（横屏 / 小屏）：整体等比收拢，避免溢出 */
@media (max-height:520px){
  .sp-seal{width:clamp(96px,22vh,140px)}
  .sp-title{font-size:clamp(26px,7vh,38px);margin-top:10px}
  .sp-sub{margin-top:8px;font-size:12px}
  .sp-line{margin-top:12px}
  .sp-halo{width:min(58vh,300px)}
}
