﻿/* ===== Safe Interactive Portfolio Effects ===== */

:root {
  --safe-cyan: #2dd4bf;
  --safe-blue: #38bdf8;
  --safe-purple: #a78bfa;
  --safe-bg-dark: #020617;
}

html,
body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100% !important;
  scroll-behavior: smooth;
}

body {
  position: relative;
}

/* 顶部滚动进度条 */
.safe-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  z-index: 99999;
  background: linear-gradient(90deg, var(--safe-cyan), var(--safe-blue), var(--safe-purple));
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.9);
}

/* 动态网格背景 */
.safe-grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(45, 212, 191, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.35;
  animation: safeGridMove 12s linear infinite;
  mask-image: radial-gradient(circle at center, black 20%, transparent 85%);
}

@keyframes safeGridMove {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 460px;
  }
}

/* 扫描光 */
.safe-scan-light {
  position: fixed;
  inset: -20%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 44%,
    rgba(45, 212, 191, 0.12) 49%,
    rgba(56, 189, 248, 0.16) 50%,
    rgba(167, 139, 250, 0.12) 51%,
    transparent 56%,
    transparent 100%
  );
  animation: safeScan 7s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes safeScan {
  0% {
    transform: translateX(-70%);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translateX(70%);
    opacity: 0;
  }
}

/* 粒子层 */
.safe-particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* 鼠标荧光，不隐藏原始鼠标 */
.safe-cursor-glow {
  position: fixed;
  width: 52px;
  height: 52px;
  left: 0;
  top: 0;
  border-radius: 999px;
  pointer-events: none;
  z-index: 100000;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: radial-gradient(circle, rgba(45, 212, 191, 0.18), transparent 70%);
  box-shadow:
    0 0 0 2px rgba(45, 212, 191, 0.75),
    0 0 22px rgba(45, 212, 191, 0.9),
    0 0 46px rgba(56, 189, 248, 0.65);
  transition: width 0.18s ease, height 0.18s ease, box-shadow 0.18s ease;
}

.safe-cursor-glow.active {
  width: 72px;
  height: 72px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 26px rgba(45, 212, 191, 1),
    0 0 58px rgba(167, 139, 250, 0.8);
}

/* 卡片悬浮发光 */
.project-card,
.card,
.skill-card,
.work-card,
.photo-card,
.hero-card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
  will-change: transform;
}

.project-card:hover,
.card:hover,
.skill-card:hover,
.work-card:hover,
.photo-card:hover,
.hero-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.28),
    0 0 42px rgba(45, 212, 191, 0.24);
  border-color: rgba(45, 212, 191, 0.55) !important;
}

/* 按钮动效 */
a,
button,
.btn {
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

a:hover,
button:hover,
.btn:hover {
  transform: translateY(-3px);
}

/* 标题流光 */
h1,
h2,
.hero-title,
.title {
  background: linear-gradient(90deg, #ffffff, #67e8f9, #a7f3d0, #a78bfa, #ffffff);
  background-size: 280% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: safeTitleFlow 5s linear infinite;
}

@keyframes safeTitleFlow {
  to {
    background-position: 280% center;
  }
}

/* 关于我文字可读性 */
.about-desc {
  color: rgba(255, 255, 255, 0.96) !important;
  font-size: 1.12rem;
  line-height: 1.95;
  font-weight: 500;
  max-width: 980px;
  padding: 18px 22px;
  margin-top: 18px;
  border-radius: 16px;
  background: rgba(3, 10, 30, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* 右下角快捷导航 */
.safe-floating-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(103, 232, 249, 0.28);
  backdrop-filter: blur(16px);
  box-shadow:
    0 20px 70px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(45, 212, 191, 0.16);
}

.safe-floating-dock a {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  text-decoration: none;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.28), rgba(59, 130, 246, 0.16));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.safe-floating-dock a:hover {
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.5);
}

/* 页面内容永远不隐藏，防止之前问题复发 */
.reveal,
.reveal.visible,
section,
.hero,
.about,
.contact,
.project-card,
.card,
.skill-card,
.work-card,
.photo-card,
.hero-card {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
}

/* 底部不留大空白 */
main,
section:last-of-type,
footer,
.footer {
  margin-bottom: 0 !important;
}

footer,
.footer {
  padding-bottom: 28px !important;
}

@media (max-width: 768px) {
  .safe-cursor-glow {
    display: none;
  }

  .safe-floating-dock {
    right: 12px;
    bottom: 12px;
    transform: scale(0.9);
    transform-origin: right bottom;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===== 保持荧光光标紧贴鼠标 ===== */
.safe-cursor-glow {
  transition:
    width 0.16s ease,
    height 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease !important;
  will-change: left, top, width, height;
}


/* ===== 全站统一强化荧光光标：首页 + 详情页 ===== */
.safe-cursor-glow {
  width: 58px !important;
  height: 58px !important;
  border: 2.5px solid rgba(255, 255, 255, 1) !important;
  background: radial-gradient(circle, rgba(255,255,255,0.20) 0%, rgba(45,212,191,0.20) 38%, transparent 76%) !important;
  box-shadow:
    0 0 0 2px rgba(45, 212, 191, 0.95),
    0 0 18px rgba(255, 255, 255, 0.95),
    0 0 36px rgba(45, 212, 191, 0.95),
    0 0 70px rgba(56, 189, 248, 0.75),
    0 0 96px rgba(167, 139, 250, 0.45) !important;
  mix-blend-mode: screen;
  transition:
    width 0.14s ease,
    height 0.14s ease,
    box-shadow 0.14s ease,
    background 0.14s ease !important;
  will-change: left, top, width, height;
}

.safe-cursor-glow.active {
  width: 78px !important;
  height: 78px !important;
  background: radial-gradient(circle, rgba(255,255,255,0.24) 0%, rgba(45,212,191,0.24) 40%, transparent 78%) !important;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 1),
    0 0 24px rgba(255, 255, 255, 1),
    0 0 48px rgba(45, 212, 191, 1),
    0 0 82px rgba(56, 189, 248, 0.85),
    0 0 110px rgba(167, 139, 250, 0.65) !important;
}

