:root {
  --fontcolor: #c8e6ff;
  --bgcolor: #05060f;
  --visitedcolor: #9adfff;

  --neon-cyan: #00f0ff;
  --neon-magenta: #ff2bd6;
  --neon-yellow: #f8ff00;
  --panel: rgba(10, 16, 32, 0.72);
  --panel-border: rgba(0, 240, 255, 0.35);
  --text-dim: #6f87a8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: var(--bgcolor);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 43, 214, 0.1), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(0, 240, 255, 0.08), transparent 50%);
  background-attachment: fixed;
}

/* 粒子背景画布 */
#particle-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* 全局扫描线 */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.25) 0 2px,
      transparent 2px 5px);
  pointer-events: none;
  z-index: 9999;
}

/* 顶部霓虹光线 */
html::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan), var(--neon-yellow));
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.8), 0 0 24px rgba(255, 43, 214, 0.6);
  z-index: 9999;
}

body {
  margin: 0 auto;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--fontcolor);
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 960px;
  min-width: 540px;
}

::selection {
  background: var(--neon-magenta);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #070a14;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-magenta));
}

h1 {
  font-size: 24px;
}
h2 {
  font-size: 20px;
  color: #fff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

p {
  font-size: 18px;
}

ul,
li,
ol {
  list-style-type: none;
}

a {
  text-decoration: none;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
  transition: 0.3s;
}
a:hover {
  text-decoration: underline;
  text-shadow: 0 0 10px var(--neon-cyan), 0 0 24px rgba(0, 240, 255, 0.6);
}
a:visited {
  color: var(--visitedcolor);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
}

.info h1 {
  position: relative;
  font-size: 44px;
  color: #fff;
  letter-spacing: 10px;
  text-shadow:
    0 0 8px rgba(0, 240, 255, 0.9),
    0 0 22px rgba(0, 240, 255, 0.5),
    0 0 40px rgba(0, 240, 255, 0.35);
}
.info h1::before,
.info h1::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.info h1::before {
  color: var(--neon-magenta);
  text-shadow: 0 0 10px var(--neon-magenta);
  clip-path: inset(0 0 55% 0);
  animation: glitch-a 3.2s infinite steps(1, end);
}
.info h1::after {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
  clip-path: inset(55% 0 0 0);
  animation: glitch-b 3.2s infinite steps(1, end);
}

@keyframes glitch-a {
  0%, 86%, 100% {
    transform: translate(0, 0);
    opacity: 0.8;
  }
  88% {
    transform: translate(-5px, -2px);
    opacity: 0.9;
  }
  91% {
    transform: translate(4px, 1px);
  }
  94% {
    transform: translate(-3px, 2px);
  }
}
@keyframes glitch-b {
  0%, 86%, 100% {
    transform: translate(0, 0);
    opacity: 0.8;
  }
  88% {
    transform: translate(5px, 2px);
    opacity: 0.9;
  }
  91% {
    transform: translate(-4px, -1px);
  }
  94% {
    transform: translate(3px, -2px);
  }
}

.info p {
  font-size: 20px;
  margin: 10px 0;
  color: var(--neon-yellow);
  letter-spacing: 6px;
  text-shadow: 0 0 8px rgba(248, 255, 0, 0.6), 0 0 20px rgba(248, 255, 0, 0.3);
}

.contact span {
  display: inline-block;
  margin-right: 16px;
}

.avator {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  overflow: hidden;
  transition: 0.5s;
  border: 2px solid var(--neon-cyan);
  box-shadow:
    0 0 12px rgba(0, 240, 255, 0.8),
    inset 0 0 12px rgba(0, 240, 255, 0.4);
}
.avator img {
  width: 100%;
  object-fit: cover;
  border-radius: 50%;
  transition: 0.5s;
}
.avator:hover {
  border-color: var(--neon-magenta);
  box-shadow:
    0 0 18px rgba(255, 43, 214, 0.9),
    inset 0 0 14px rgba(255, 43, 214, 0.5);
}

section {
  padding: 20px 0;
  margin: 10px;
  transition: all 0.3s;
}

section > h1 {
  display: inline-block;
  position: relative;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.8), 0 0 18px rgba(0, 240, 255, 0.4);
}
section > h1::before {
  content: "//";
  color: var(--neon-magenta);
  text-shadow: 0 0 8px rgba(255, 43, 214, 0.8);
  margin-right: 10px;
}
section > h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), transparent);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
}

section ul li {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 20px;
  margin: 10px 0;
  transition: all 0.3s;
  backdrop-filter: blur(2px);
}

section ul li:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.06);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35), inset 0 0 14px rgba(0, 240, 255, 0.1);
  transform: translateY(-2px);
}
section ul li:nth-child(even) {
  border-color: rgba(255, 43, 214, 0.35);
}
section ul li:nth-child(even):hover {
  border-color: var(--neon-magenta);
  background: rgba(255, 43, 214, 0.06);
  box-shadow: 0 0 14px rgba(255, 43, 214, 0.35), inset 0 0 14px rgba(255, 43, 214, 0.1);
}

/* HUD 切角装饰 */
.experience ul li::before,
.experience ul li::after,
.education ul li::before,
.education ul li::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: 0.3s;
}
.experience ul li::before,
.education ul li::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--neon-cyan);
  border-left: 2px solid var(--neon-cyan);
}
.experience ul li::after,
.education ul li::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--neon-magenta);
  border-bottom: 2px solid var(--neon-magenta);
}
.experience ul li:hover::before,
.education ul li:hover::before {
  box-shadow: -2px -2px 8px rgba(0, 240, 255, 0.6);
}
.experience ul li:hover::after,
.education ul li:hover::after {
  box-shadow: 2px 2px 8px rgba(255, 43, 214, 0.6);
}

.about {
  border: none;
}

.about p {
  color: var(--text-dim);
  line-height: 1.9;
}

.experience ul li {
  display: flex;
  align-items: center;
}

.experience ul li img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.education ul {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
}

.education ul li {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.education ul li img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

.skills ul li {
  border-left: 3px solid var(--neon-magenta);
}
.skills ul li:hover {
  border-color: var(--neon-cyan);
  border-left-color: var(--neon-cyan);
}

.workslist {
  height: 100%;
  margin: 20px 0;
}

.workslist h3 {
  color: var(--neon-cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.7);
  margin-bottom: 10px;
}

.workslist .swiper {
  --swiper-theme-color: var(--neon-cyan);
  width: 100%;
  margin: 20px 0;
}

.workslist .swiper-slide img {
  width: 100%;
  object-fit: contain;
  border: 1px solid var(--panel-border);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.workslist .swiper-pagination-bullet {
  background: var(--text-dim);
  opacity: 1;
}
.workslist .swiper-pagination-bullet-active {
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}

.workslist .swiper-button-prev,
.workslist .swiper-button-next {
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.8));
}

.swiper-lazy-preloader {
  height: 400px;
  width: 100%;
}

footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--panel-border);
  color: var(--text-dim);
}

footer p {
  font-size: 14px;
}
footer a {
  color: var(--text-dim);
  text-shadow: none;
}
footer a:hover {
  color: var(--neon-cyan);
}

@media screen and (max-width: 960px) {
  body {
    width: 100%;
    padding: 0 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .info h1::before,
  .info h1::after {
    animation: none;
  }
}

/* ============ 自定义赛博朋克鼠标 ============ */
body.custom-cursor,
body.custom-cursor * {
  cursor: none !important;
}

#cursor-dot {
  position: fixed;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  transform: translate(-100px, -100px);
  pointer-events: none;
  z-index: 100000;
  opacity: 0;
  transition: opacity 0.2s;
}

#cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  transform: translate(-100px, -100px);
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transition: width 0.25s, height 0.25s, opacity 0.2s;
}
/* 旋转虚线环 */
#cursor-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(0, 240, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35), inset 0 0 6px rgba(0, 240, 255, 0.25);
  animation: cursor-spin 6s linear infinite;
  transition: border-color 0.25s, box-shadow 0.25s;
}
/* 十字刻度（上下左右四个） */
#cursor-ring::after {
  content: "";
  position: absolute;
  inset: -7px;
  background:
    linear-gradient(var(--neon-cyan), var(--neon-cyan)) center top / 1px 6px no-repeat,
    linear-gradient(var(--neon-cyan), var(--neon-cyan)) center bottom / 1px 6px no-repeat,
    linear-gradient(var(--neon-cyan), var(--neon-cyan)) left center / 6px 1px no-repeat,
    linear-gradient(var(--neon-cyan), var(--neon-cyan)) right center / 6px 1px no-repeat;
}
#cursor-ring.hover::before {
  border-color: rgba(255, 43, 214, 0.9);
  box-shadow: 0 0 16px rgba(255, 43, 214, 0.5), inset 0 0 10px rgba(255, 43, 214, 0.35);
}
#cursor-ring.hover {
  width: 52px;
  height: 52px;
}

@keyframes cursor-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============ 放大镜 ============ */
#lens {
  position: fixed;
  left: 0;
  top: 0;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 99998;
  border: 2px solid var(--neon-cyan);
  box-shadow:
    0 0 16px rgba(0, 240, 255, 0.6),
    inset 0 0 20px rgba(0, 240, 255, 0.25);
  background: rgba(5, 6, 15, 0.6);
  opacity: 0;
  transition: opacity 0.15s;
}
#lens.on {
  opacity: 1;
}
#lens .lens-clone {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
#lens .lens-line-h,
#lens .lens-line-v {
  position: absolute;
  background: rgba(0, 240, 255, 0.3);
  pointer-events: none;
}
#lens .lens-line-h {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}
#lens .lens-line-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}
#lens .lens-tag {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px rgba(248, 255, 0, 0.8);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* 子弹特效画布 */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99990;
}

/* 子弹命中抖动 */
@keyframes bullet-shake {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(-3px, 2px) rotate(-0.6deg);
  }
  40% {
    transform: translate(3px, -2px) rotate(0.6deg);
  }
  60% {
    transform: translate(-2px, -1px) rotate(-0.4deg);
  }
  80% {
    transform: translate(2px, 1px) rotate(0.4deg);
  }
}
.bullet-hit {
  animation: bullet-shake 0.3s linear !important;
}

@media (prefers-reduced-motion: reduce) {
  #cursor-ring::before {
    animation: none;
  }
}
