/* ==========================================================
   封面 Splash —— 数码/科技风格
   纯 CSS + 内联 SVG 实现，不加载任何图片 / 字体 / 脚本
   ========================================================== */

.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(880px 620px at 50% 40%, rgba(34, 211, 238, .11), transparent 62%),
    radial-gradient(720px 520px at 50% 108%, rgba(124, 255, 107, .07), transparent 60%),
    #05080e;
  animation: splashIn .45s ease both;
}

.splash.is-out {
  animation: splashOut .42s ease forwards;
  pointer-events: none;
}

/* hidden 必须压过 display:flex，否则封面关不掉；
   从 display:none 恢复时 CSS 动画会自动重播，无需手动重置 */
.splash[hidden] { display: none; }

@keyframes splashIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes splashOut { to { opacity: 0; transform: scale(1.03); visibility: hidden; } }

/* ---------- 背景：网格 + 扫描线 ---------- */

.splash-grid {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 211, 238, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .075) 1px, transparent 1px);
  background-size: 46px 46px;
  animation: gridDrift 26s linear infinite;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 28%, transparent 70%);
          mask-image: radial-gradient(circle at 50% 46%, #000 28%, transparent 70%);
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 46px, 46px 0; }
}

.splash-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 190px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .07) 68%, rgba(34, 211, 238, .17));
  animation: scanSweep 7.5s linear infinite;
}

@keyframes scanSweep {
  from { transform: translateY(-200px); }
  to   { transform: translateY(100vh); }
}

/* ---------- 主体布局 ---------- */

.splash-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  max-width: 1040px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

.splash-copy {
  flex: 1 1 380px;
  min-width: 300px;
}

/* ---------- 芯片图形 ---------- */

.cover-chip {
  flex: 0 0 auto;
  width: clamp(200px, 30vh, 288px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 30px rgba(34, 211, 238, .26));
}

/* 绘制动画：--l 为路径长度，--d 为延迟，--o 为最终不透明度 */
.cc-draw {
  stroke-dasharray: var(--l, 800);
  stroke-dashoffset: var(--l, 800);
  animation: ccDraw 1.4s var(--d, 0s) cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes ccDraw { to { stroke-dashoffset: 0; } }

.cc-fade {
  opacity: 0;
  animation: ccFade .7s var(--d, 0s) ease forwards;
}
@keyframes ccFade { to { opacity: var(--o, 1); } }

.cc-pop {
  opacity: 0;
  transform: scale(.66);
  transform-origin: center;
  transform-box: fill-box;
  animation: ccPop .5s var(--d, 0s) cubic-bezier(.34, 1.56, .64, 1) forwards;
}
@keyframes ccPop { to { opacity: 1; transform: scale(1); } }

.cc-pulse { animation: ccPulse 2.8s var(--d, 0s) ease-in-out infinite; }
@keyframes ccPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ---------- 文案 ---------- */

.cover-eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .34em;
  color: var(--accent-2);
  text-transform: uppercase;
  margin: 0 0 14px;
  opacity: 0;
  animation: riseIn .6s .15s ease forwards;
}

.cover-title {
  margin: 0 0 16px;
  font-size: clamp(28px, 4.6vw, 46px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: .01em;
  color: #eaf3fb;
  opacity: 0;
  animation: riseIn .7s .3s ease forwards;
}

.cover-title em {
  font-style: normal;
  font-family: var(--mono);
  color: var(--accent-2);
  text-shadow: 0 0 22px rgba(34, 211, 238, .5);
}

.cover-sub {
  margin: 0 0 26px;
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.85;
  color: var(--dim);
  max-width: 44ch;
  opacity: 0;
  animation: riseIn .7s .45s ease forwards;
}

.cover-sub b { color: #b9cadb; font-weight: 600; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 指标 ---------- */

.cover-stats {
  display: flex;
  gap: 10px;
  margin: 0 0 30px;
  flex-wrap: wrap;
  opacity: 0;
  animation: riseIn .7s .6s ease forwards;
}

.cover-stats > div {
  flex: 1 1 96px;
  padding: 11px 14px;
  background: rgba(18, 27, 38, .72);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  backdrop-filter: blur(2px);
}

/* 手机端去掉实时模糊：背景是静态渐变，去模糊后观感几乎无差，
   但能省掉每个小卡的离屏模糊合成（封面就是首屏，最不该卡）。
   注意这条必须写在本文件内 —— style.css 在 <link> 里排在本文件之前，
   同优先级的选择器会被本文件覆盖。 */
@media (max-width: 700px) {
  .cover-stats > div { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.cover-stats b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.25;
}

.cover-stats span {
  font-size: 11.5px;
  color: var(--dim-2);
  letter-spacing: .04em;
}

/* ---------- 进入按钮 ---------- */

.cover-enter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 30px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: #04121a;
  background: linear-gradient(135deg, #5eead4, #22d3ee);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, .5), 0 10px 30px -8px rgba(34, 211, 238, .55);
  opacity: 0;
  animation: riseIn .7s .75s ease forwards;
}

.cover-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, .8), 0 16px 38px -8px rgba(34, 211, 238, .75);
}

.cover-enter:active { transform: translateY(0); }

.cover-enter span {
  transition: transform .16s ease;
}
.cover-enter:hover span { transform: translateX(4px); }

.cover-hint {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--dim-2);
  opacity: 0;
  animation: ccFade .8s 1.05s ease forwards;
  --o: 1;
}

.cover-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
}

/* 封面底部：自媒体账号 */
.cover-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  opacity: 0;
  animation: riseIn .7s 1.2s ease forwards;
}

/* ---------- 窄屏：单列 ---------- */

@media (max-width: 860px) {
  .splash { padding: 20px 18px; overflow-y: auto; }
  .splash-inner { flex-direction: column; text-align: center; gap: 22px; }
  .cover-chip { width: clamp(160px, 40vw, 220px); }
  .cover-sub { margin-left: auto; margin-right: auto; }
  .cover-stats > div { flex: 1 1 84px; }
  .cover-stats { justify-content: center; }
}

/* ---------- 顶部「封面」按钮 ---------- */

.chip-btn {
  font: inherit;
  cursor: pointer;
  color: var(--dim);
  transition: color .16s ease, border-color .16s ease;
}

.chip-btn:hover {
  color: var(--accent-2);
  border-color: var(--border-2);
}

/* ---------- 尊重「减少动态效果」偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
  .splash-grid, .splash-scan, .cc-pulse { animation: none; }
  .cc-draw, .cc-fade, .cc-pop, .cover-eyebrow, .cover-title,
  .cover-sub, .cover-stats, .cover-enter, .cover-hint {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
  }
}

/* ==================== 复审修复 ==================== */

/* .cc-pulse 用 animation 简写覆盖了同一元素上的 .cc-pop 动画；
   在 reduced-motion 下 animation:none 会让时钟源圆点停在 opacity:0（直接看不见） */
@media (prefers-reduced-motion: reduce) {
  .cc-pop { opacity: var(--o, 1); transform: none; }
  .cover-resume { animation: none !important; }
}

/* 矮视口（横屏手机）：封面原本 overflow:hidden 且不可滚，932×430 时 social 卡片 bottom=459 > vh 被裁死 */
@media (max-height: 560px) {
  .splash { overflow-y: auto; }
  .splash-inner { gap: 16px; padding-top: 24px; padding-bottom: 24px; }
  .cover-chip { display: none; }
}

/* 「继续上次」按钮（进度持久化，见 app.js / toy.js） */
.cover-resume {
  display: inline-block;
  margin: 12px 0 0;
  padding: 11px 20px;
  font: inherit;
  font-size: 14px;
  color: var(--accent-2);
  background: rgba(56, 217, 217, .08);
  border: 1px solid rgba(56, 217, 217, .38);
  border-radius: 10px;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.cover-resume[hidden] { display: none; }
.cover-resume:hover { background: rgba(56, 217, 217, .16); border-color: rgba(56, 217, 217, .6); }
