/* ==========================================================================
   天智 · 开场 Logo 动画
   顺序：Logo 浮现 → 整体左移 → 「阳光海天」四字依次浮出 → 副标题 → 淡出揭幕
   只动 transform / opacity / filter，60fps；减少动效时整段跳过
   ========================================================================== */

.splash {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  place-items: center;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

/* 只有脚本确认要播时才显示；无 JS 时不会挡住页面 */
html.splash-on .splash { display: grid; }
html.splash-on,
html.splash-on body { overflow: hidden; }

/* 极淡的品牌光晕，避免纯白发空 */
.splash::before {
  content: "";
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(42% 42% at 50% 48%, rgba(1, 83, 205, .085), transparent 68%),
    radial-gradient(26% 26% at 50% 48%, rgba(200, 16, 46, .055), transparent 70%);
  animation: splashBreath 4.4s ease-in-out infinite alternate;
}

@keyframes splashBreath {
  0% { opacity: .72; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

.splash__stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3.4vw, 30px);
  padding: 0 24px;
  text-align: center;
}

/* ------------------------------------------------ Logo + 四字 */

.splash__group {
  --pre: 0px;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 20px);
  transform: translateX(var(--pre));
  will-change: transform;
}

.splash__mark {
  position: relative;
  flex: 0 0 auto;
  width: clamp(54px, 7vw, 74px);
  height: clamp(53px, 6.9vw, 73px);
  opacity: 0;
  transform: scale(.7) rotate(-12deg);
}.splash__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Logo 外圈脉冲 */
.splash__ring {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(1, 83, 205, .26);
  opacity: 0;
  transform: scale(.62);
}

/* Logo 上掠过的一道光，在四字出现时扫一次 */
.splash__mark::after {
  content: "";
  position: absolute;
  inset: -30% -40%;
  background: linear-gradient(
    102deg,
    transparent 38%,
    rgba(255, 255, 255, .92) 50%,
    transparent 62%
  );
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
}

.splash__words {
  display: flex;
  align-items: baseline;
  gap: .04em;
  white-space: nowrap;
}

.splash__word {
  display: inline-block;
  color: #003893;
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.1;
  opacity: 0;
  transform: translate3d(-16px, 16px, 0) scale(.82);
  filter: blur(10px);
  will-change: transform, opacity, filter;
}

.splash__sub {
  position: relative;
  margin: 0;
  color: #7b8a9e;
  font-size: clamp(10px, 1.45vw, 12px);
  letter-spacing: .3em;
  opacity: 0;
  transform: translateY(8px);
}

/* 副标题下的短线：从中心向两侧展开，收住整个动画 */
.splash__sub::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c5d0dc, transparent);
  transform: translateX(-50%) scaleX(0);
  opacity: 0;
}

.splash.is-sub .splash__sub::after {
  animation: splashRule .78s cubic-bezier(.16, 1, .3, 1) .22s forwards;
}

@keyframes splashRule {
  0% { opacity: 0; transform: translateX(-50%) scaleX(0); }
  100% { opacity: 1; transform: translateX(-50%) scaleX(1); }
}

/* ------------------------------------------------ 播放状态 */

.splash.is-mark .splash__mark {
  animation: splashMarkIn .74s cubic-bezier(.19, 1.16, .32, 1) forwards;
}

.splash.is-mark .splash__ring {
  animation: splashRing 1.15s cubic-bezier(.2, .9, .3, 1) .12s forwards;
}

.splash.is-shift .splash__group {
  animation: splashShift .82s cubic-bezier(.22, 1, .24, 1) forwards;
}

.splash.is-words .splash__word {
  animation: splashWord .74s cubic-bezier(.22, 1.18, .36, 1) forwards;
  animation-delay: calc(var(--i, 0) * 96ms);
}

.splash.is-words .splash__mark::after {
  animation: splashSheen .78s cubic-bezier(.4, 0, .3, 1) .08s forwards;
}

.splash.is-sub .splash__sub {
  animation: splashSub .68s cubic-bezier(.16, 1, .3, 1) forwards;
}

@keyframes splashMarkIn {
  0% { opacity: 0; transform: scale(.7) rotate(-12deg); }
  62% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes splashRing {
  0% { opacity: 0; transform: scale(.62); }
  35% { opacity: .85; }
  100% { opacity: 0; transform: scale(1.5); }
}

/* 左移到「Logo 居中」：尾部带一点缓回弹，不硬停 */
@keyframes splashShift {
  0% { transform: translateX(var(--pre)) scale(1); }
  72% { transform: translateX(-7px) scale(.992); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes splashWord {
  0% { opacity: 0; transform: translate3d(-16px, 16px, 0) scale(.82); filter: blur(10px); }
  52% { opacity: 1; filter: blur(.5px); }
  76% { transform: translate3d(2px, -3px, 0) scale(1.03); filter: blur(0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

@keyframes splashSheen {
  0% { opacity: 0; transform: translateX(-120%); }
  32% { opacity: .9; }
  100% { opacity: 0; transform: translateX(120%); }
}

@keyframes splashSub {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------ 退场 + 正文接力 */

/* 退场顺序：内容先轻轻上浮淡出 → 整层再淡出 → 正文接力，避免两层叠影 */
.splash.is-leaving .splash__stage {
  animation: splashStageOut .34s cubic-bezier(.4, 0, 1, 1) forwards;
}

.splash.is-leaving {
  animation: splashOut .46s cubic-bezier(.4, 0, .2, 1) .1s forwards;
  pointer-events: none;
}

.splash.is-leaving .splash__skip { display: none; }

@keyframes splashStageOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-14px) scale(.97); }
}

@keyframes splashOut {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

html.splash-on #site {
  opacity: 0;
  transform: translateY(10px);
}

html.splash-reveal #site {
  opacity: 1;
  transform: none;
  transition:
    opacity .8s cubic-bezier(.16, 1, .3, 1) .16s,
    transform .8s cubic-bezier(.16, 1, .3, 1) .16s;
}

/* ------------------------------------------------ 跳过按钮 */

.splash__skip {
  position: absolute;
  right: clamp(16px, 3vw, 34px);
  bottom: clamp(16px, 3vw, 30px);
  z-index: 3;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #dce3eb;
  background: rgba(255, 255, 255, .7);
  color: #7b8a9e;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .12em;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}

.splash__skip:hover,
.splash__skip:focus-visible {
  color: #003893;
  border-color: #003893;
}

/* ------------------------------------------------ 适配与降级 */

@media (max-width: 680px) {
  .splash__word { font-size: clamp(26px, 8.4vw, 36px); }
  .splash__sub { letter-spacing: .2em; font-size: 10px; }
  .splash__mark { width: 52px; height: 51px; }
  .splash__group { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .splash,
  .splash * {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  html.splash-on .splash { display: none; }
  html.splash-on #site,
  html.splash-reveal #site { opacity: 1 !important; transform: none !important; }
}

@media print {
  .splash { display: none !important; }
  html.splash-on #site { opacity: 1 !important; transform: none !important; }
}
