/* =====================================================================
   穿过地球 · 隧道过渡动画（纯矢量：SVG + transform / opacity）
   所有图层都局限在 .tunnel-fx 内，不影响页面既有样式。
   ===================================================================== */

.tunnel-fx {
  position: fixed;
  inset: 0;
  z-index: 3000;
  overflow: hidden;
  contain: layout paint;
  pointer-events: none;
}
.tunnel-fx.tf-out {
  opacity: 0;
  transition: opacity .18s linear;
}

/* ---------- 裂纹与洞口边缘 ---------- */
.tf-cracks,
.tf-rim-layer {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}
.tf-cracks path {
  fill: none;
  stroke: rgba(243, 208, 138, .92);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 暗色衬底：在任何底图上都能压出一道裂痕 */
.tf-cracks .tf-crack-shade {
  stroke: rgba(4, 7, 13, .62);
  stroke-width: 3.6;
}

/* 洞口边缘：外圈柔光 + 内圈细线，宽度不随缩放变化 */
.tf-rim {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.tf-rim-halo {
  stroke: rgba(243, 208, 138, .16);
  stroke-width: 8;
}
.tf-rim-core {
  stroke: rgba(243, 208, 138, .68);
  stroke-width: 1.6;
}

/* ---------- 洞口本体 ---------- */
.tf-hole {
  position: absolute;
  border-radius: 50%;
  background: #05070C;
  box-shadow: 0 0 16px 2px rgba(243, 208, 138, .2);
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

/* ---------- 穿行：同心环与速度线 ---------- */
.tf-rings,
.tf-streaks {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

.tf-ring {
  fill: none;
  transform-box: view-box;
  transform-origin: 500px 500px;
  animation: tf-ring .46s linear infinite both;
  animation-delay: calc(820ms + var(--i) * 70ms);
}
.tf-ring circle {
  vector-effect: non-scaling-stroke;
}
.tf-ring-glow {
  stroke: rgba(243, 208, 138, .13);
  stroke-width: 8;
}
.tf-ring-core {
  stroke: rgba(243, 208, 138, .62);
  stroke-width: 1.3;
}
@keyframes tf-ring {
  0%   { transform: scale(.05); opacity: 0; }
  20%  { opacity: .9; }
  100% { transform: scale(1.45); opacity: 0; }
}

.tf-streak {
  stroke: rgba(243, 208, 138, .58);
  stroke-width: 1.1;
  stroke-dashoffset: 0;
  animation: tf-flow .42s linear infinite both, tf-streak-vis .54s linear both;
  animation-delay: calc(820ms + var(--i) * 32ms), calc(820ms + var(--i) * 32ms);
}
@keyframes tf-flow {
  to { stroke-dashoffset: calc(-1 * var(--len)); }
}
@keyframes tf-streak-vis {
  0%   { opacity: 0; }
  30%  { opacity: .85; }
  100% { opacity: 0; }
}

/* ---------- 破出：帷幕与金光 ---------- */
/* 帷幕整体是隧道黑幕；破出时用遮罩在幕上挖出圆形缺口，缺口里露出对跖点 */
.tf-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #0B1019 0%, #05070C 58%);
  opacity: 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  will-change: mask-image, opacity;
}
.tf-exit,
.tf-flash {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.tf-exit {
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 248, 231, .9) 0%,
    rgba(243, 208, 138, .55) 22%,
    rgba(243, 208, 138, .18) 44%,
    rgba(243, 208, 138, 0) 68%);
}
.tf-flash {
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 248, 231, .6) 0%,
    rgba(243, 208, 138, .34) 18%,
    rgba(243, 208, 138, .1) 42%,
    rgba(243, 208, 138, 0) 66%);
}
