/* ═══════════════════════════════════════════════════════════════
   帧序 · 开机动画
   ═══════════════════════════════════════════════════════════════ */

.boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(900px 620px at 50% 46%, rgba(91, 72, 150, .22), transparent 66%),
    radial-gradient(1200px 800px at 50% 120%, rgba(46, 176, 168, .07), transparent 60%),
    #05060a;
  color: #eeebf6;
  transition: opacity .6s var(--ease), visibility .6s;
}
[data-theme="day"] .boot {
  background:
    radial-gradient(900px 620px at 50% 46%, rgba(54, 148, 142, .16), transparent 66%),
    radial-gradient(1200px 800px at 50% 120%, rgba(178, 143, 92, .1), transparent 60%),
    #101513;
  color: #f2efe5;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot.is-skipped { transition-duration: .28s; }

.boot-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.boot-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 48%, transparent 20%, rgba(0, 0, 0, .58) 100%);
  pointer-events: none;
}
[data-theme="day"] .boot-vignette { background: radial-gradient(ellipse 70% 60% at 50% 48%, transparent 24%, rgba(5, 12, 11, .5) 100%); }

.boot-grid {
  position: absolute; inset: -20%;
  background-image:
    linear-gradient(to right, rgba(197, 183, 255, .075) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(197, 183, 255, .075) 1px, transparent 1px);
  background-size: 88px 88px;
  transform: perspective(900px) rotateX(58deg) translateY(-8%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, #000 4%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, #000 4%, transparent 74%);
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.boot.p1 .boot-grid { opacity: 1; }
[data-theme="day"] .boot-grid {
  background-image:
    linear-gradient(to right, rgba(110, 226, 216, .08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(110, 226, 216, .08) 1px, transparent 1px);
}

/* ── 胶片 / 分镜格 ─────────────────────────────────────────── */
.boot-frames { position: absolute; inset: 0; pointer-events: none; }
.boot-frame {
  position: absolute;
  width: 258px;
  padding: 9px;
  border: 1px solid rgba(210, 199, 255, .16);
  border-radius: 8px;
  background: rgba(12, 14, 23, .72);
  box-shadow: 0 30px 80px -30px #000, inset 0 0 40px rgba(170, 145, 255, .04);
  opacity: 0;
  transition: opacity .9s var(--ease), transform 1.2s var(--ease-out), filter 1s var(--ease);
  backdrop-filter: blur(4px);
}
[data-theme="day"] .boot-frame { border-color: rgba(120, 230, 220, .17); background: rgba(17, 26, 24, .7); box-shadow: 0 30px 80px -30px #000, inset 0 0 40px rgba(100, 220, 210, .04); }
.boot-frame::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, .1) 45%, transparent 62%);
  background-size: 250% 100%;
  animation: bf-sheen 3.4s var(--ease) infinite;
  pointer-events: none;
  opacity: 0;
}
.boot.p3 .boot-frame::after { opacity: 1; }
@keyframes bf-sheen { 0% { background-position: 180% 0; } 60%, 100% { background-position: -80% 0; } }

.bf-a { left: 8.5%; top: 18%; transform: translate3d(-90px, 40px, -240px) rotate(-7deg) scale(.86); }
.bf-b { right: 8%; top: 27%; transform: translate3d(90px, -30px, -260px) rotate(6deg) scale(.84); }
.bf-c { left: 16%; bottom: 15%; transform: translate3d(-60px, 90px, -220px) rotate(4deg) scale(.9); }
.boot.p2 .bf-a { opacity: 1; transform: translate3d(0, 0, 0) rotate(-5deg) scale(1); transition-delay: .05s; }
.boot.p2 .bf-b { opacity: .92; transform: translate3d(0, 0, 0) rotate(4.5deg) scale(1); transition-delay: .16s; }
.boot.p2 .bf-c { opacity: .8; transform: translate3d(0, 0, 0) rotate(3deg) scale(1); transition-delay: .27s; }
.boot.p4 .bf-a { opacity: 0; transform: translate3d(-40px, 24px, 120px) rotate(-8deg) scale(1.08); }
.boot.p4 .bf-b { opacity: 0; transform: translate3d(45px, -20px, 140px) rotate(7deg) scale(1.08); }
.boot.p4 .bf-c { opacity: 0; transform: translate3d(-20px, 48px, 120px) rotate(5deg) scale(1.08); }

.bf-head, .bf-foot {
  display: flex; justify-content: space-between; gap: 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .13em;
  color: rgba(214, 208, 235, .48);
  padding: 2px 2px;
}
[data-theme="day"] .bf-head, [data-theme="day"] .bf-foot { color: rgba(198, 226, 220, .48); }
.bf-art {
  position: relative;
  height: 104px;
  margin: 6px 0;
  border-radius: 4px;
  background:
    radial-gradient(circle at 68% 34%, rgba(255, 211, 150, .6) 0 3px, transparent 4px),
    linear-gradient(165deg, #26304c 0%, #151b2d 40%, #0a0c14 100%);
  overflow: hidden;
}
.bf-art::before {
  content: "";
  position: absolute;
  left: -10%; right: -10%;
  bottom: -26px;
  height: 100px;
  background:
    radial-gradient(ellipse at 30% 100%, #0d1019 0 50%, transparent 51%),
    radial-gradient(ellipse at 78% 100%, #111621 0 48%, transparent 49%);
}
.bf-art::after {
  content: "";
  position: absolute;
  left: 24%; bottom: 0; width: 3px; height: 54px;
  background: #05070c;
  box-shadow: 18px 12px 0 -1px #05070c;
  border-radius: 2px 2px 0 0;
}
.bf-lines { display: flex; flex-direction: column; gap: 7px; padding: 18px 4px; }
.bf-lines i { height: 4px; border-radius: 2px; background: rgba(205, 196, 238, .22); }
.bf-lines i:nth-child(1) { width: 62%; background: rgba(200, 178, 255, .5); }
.bf-lines i:nth-child(2) { width: 88%; }
.bf-lines i:nth-child(3) { width: 74%; }
.bf-lines i:nth-child(4) { width: 44%; }
.bf-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px 2px; }
.bf-cells i { height: 29px; border: 1px solid rgba(205, 194, 240, .2); border-radius: 2px; background: rgba(180, 158, 255, .06); }
.bf-cells i:nth-child(2), .bf-cells i:nth-child(6) { background: rgba(180, 158, 255, .22); border-color: rgba(210, 190, 255, .4); }
.boot-frame { animation: bf-float 7s ease-in-out infinite; }
.bf-b { animation-delay: -2.2s; }
.bf-c { animation-delay: -4.1s; }
@keyframes bf-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -8px; } }

/* ── 中央 LOGO ─────────────────────────────────────────────── */
.boot-core {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(-2vh);
}
.boot-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  margin-bottom: 26px;
  color: #d9ceff;
  opacity: 0;
  transform: scale(.82);
  filter: blur(10px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease-out), filter 1s var(--ease);
}
[data-theme="day"] .boot-mark { color: #a9f0e8; }
.boot.p3 .boot-mark { opacity: 1; transform: scale(1); filter: blur(0); }
.boot-mark svg { width: 58px; height: 58px; position: relative; z-index: 2; filter: drop-shadow(0 0 16px rgba(180, 150, 255, .5)); }
[data-theme="day"] .boot-mark svg { filter: drop-shadow(0 0 16px rgba(90, 230, 215, .4)); }
.boot-mark-ring {
  position: absolute; inset: -6px;
  border: 1px solid rgba(196, 174, 255, .28);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.4);
  transition: opacity 1s .1s var(--ease), transform 1.4s .1s var(--ease-out);
}
.boot-mark-ring::before, .boot-mark-ring::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid transparent;
}
.boot-mark-ring::before { inset: 8px; border-top-color: rgba(224, 214, 255, .75); border-right-color: rgba(224, 214, 255, .18); animation: ring-spin 5.5s linear infinite; }
.boot-mark-ring::after { inset: -14px; border-bottom-color: rgba(196, 174, 255, .2); animation: ring-spin 9s linear infinite reverse; }
.boot-mark-ring.r2 { inset: -22px; border-color: rgba(196, 174, 255, .1); }
.boot.p2 .boot-mark-ring { opacity: 1; transform: scale(1); }
.boot.p2 .boot-mark-ring.r2 { transition-delay: .2s; }
[data-theme="day"] .boot-mark-ring { border-color: rgba(120, 230, 220, .22); }
@keyframes ring-spin { to { transform: rotate(360deg); } }

.boot-word {
  font-family: var(--font-display);
  font-size: clamp(54px, 7.2vw, 82px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .24em;
  padding-left: .24em;
  opacity: 0;
  transform: translateY(14px);
  filter: blur(14px);
  transition: opacity 1.1s .08s var(--ease), transform 1.2s .08s var(--ease-out), filter 1s .08s var(--ease);
  background: linear-gradient(180deg, #fbf9ff 10%, #c9bcf0 70%, #8a7bb8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="day"] .boot-word { background: linear-gradient(180deg, #fffef7 10%, #bde9e2 72%, #76a8a1 100%); -webkit-background-clip: text; background-clip: text; }
.boot.p3 .boot-word { opacity: 1; transform: translateY(0); filter: blur(0); }
.boot-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .32em;
  color: rgba(216, 209, 238, .48);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .9s .36s var(--ease), transform .9s .36s var(--ease-out);
}
.boot-sub i { width: 22px; height: 1px; background: currentColor; opacity: .5; }
.boot.p3 .boot-sub { opacity: 1; transform: translateY(0); }
.boot-tagline {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .3em;
  color: rgba(216, 209, 238, .36);
  opacity: 0;
  transition: opacity 1s .55s var(--ease);
}
.boot.p3 .boot-tagline { opacity: 1; }
[data-theme="day"] .boot-sub, [data-theme="day"] .boot-tagline { color: rgba(208, 230, 225, .45); }

/* 中央柔光 */
.boot-core::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 520px; height: 520px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(126, 96, 208, .18), transparent 64%);
  z-index: -1;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}
.boot.p3 .boot-core::before { opacity: 1; }
[data-theme="day"] .boot-core::before { background: radial-gradient(circle, rgba(76, 196, 185, .14), transparent 64%); }

/* ── HUD 仪表 ──────────────────────────────────────────────── */
.boot-hud {
  position: absolute;
  inset: 30px 34px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .16em;
  color: rgba(209, 202, 231, .3);
  opacity: 0;
  transition: opacity 1.2s .3s var(--ease);
}
.boot.p1 .boot-hud { opacity: 1; }
.boot-hud span { position: absolute; }
.hud-tl { left: 0; top: 0; }
.hud-tr { right: 0; top: 0; }
.hud-bl { left: 0; bottom: 0; }
.hud-br { right: 0; bottom: 0; }
.hud-tl b { color: #ff7d72; font-size: 8px; animation: dot-pulse 1.8s infinite; }
.boot-hud::before, .boot-hud::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-color: rgba(211, 201, 240, .18); border-style: solid;
}
.boot-hud::before { left: -10px; top: -10px; border-width: 1px 0 0 1px; }
.boot-hud::after { right: -10px; bottom: -10px; border-width: 0 1px 1px 0; }

/* ── 进度 ──────────────────────────────────────────────────── */
.boot-progress {
  position: absolute;
  left: 50%;
  bottom: 7.4vh;
  width: min(380px, 62vw);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .8s var(--ease);
}
.boot.p1 .boot-progress { opacity: 1; }
.boot-track { height: 1px; background: rgba(214, 205, 240, .14); overflow: hidden; }
.boot-track span {
  display: block; width: 0; height: 100%;
  background: linear-gradient(90deg, transparent, #c9b7ff 30%, #fff 100%);
  box-shadow: 0 0 12px rgba(190, 165, 255, .7);
  transition: width .3s linear;
}
[data-theme="day"] .boot-track span { background: linear-gradient(90deg, transparent, #76e6dc 30%, #fff 100%); box-shadow: 0 0 12px rgba(90, 225, 212, .6); }
.boot-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .18em;
  color: rgba(209, 202, 231, .4);
}
.boot-meta #boot-pct { color: rgba(228, 219, 252, .75); }
.boot-skip {
  position: absolute;
  right: 32px;
  bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(210, 200, 240, .12);
  color: rgba(214, 207, 236, .42);
  font-size: 10.5px;
  letter-spacing: .08em;
  opacity: 0;
  transition: opacity .8s .5s var(--ease), color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.boot.p1 .boot-skip { opacity: 1; }
.boot-skip:hover { color: #efeaff; background: rgba(190, 165, 255, .08); border-color: rgba(210, 200, 240, .25); }
.boot-skip kbd {
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 2px 5px;
  border: 1px solid rgba(210, 200, 240, .2);
  border-radius: 3px;
}

/* 扫描光 */
.boot::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 34vh;
  background: linear-gradient(180deg, transparent, rgba(190, 170, 255, .035) 50%, transparent);
  animation: boot-scan 4.8s var(--ease) infinite;
  pointer-events: none;
}
@keyframes boot-scan { 0% { transform: translateY(-40vh); } 100% { transform: translateY(130vh); } }

@media (max-width: 1100px) {
  .boot-frame { width: 210px; }
  .bf-a { left: 3%; top: 13%; }
  .bf-b { right: 2%; top: 22%; }
  .bf-c { left: 7%; bottom: 12%; }
}
@media (max-width: 760px) {
  .boot-frames { display: none; }
  .boot-hud { inset: 18px 20px; }
  .boot-hud .hud-bl, .boot-hud .hud-br { display: none; }
  .boot-progress { bottom: 10vh; width: 72vw; }
  .boot-skip { right: 50%; transform: translateX(50%); bottom: 20px; }
  .boot-mark { width: 74px; height: 74px; margin-bottom: 20px; }
  .boot-sub { letter-spacing: .2em; font-size: 8px; }
  .boot-tagline { font-size: 11px; letter-spacing: .2em; }
}
