html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: #031321;
  overflow: hidden;
  height: 100%;
}

@keyframes scan {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 -4px;
  }
}

.glitch {
  position: relative;
  color: #03e9f4;
  font-size: 2em;
  letter-spacing: 0.1em;
  animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #031321;
  overflow: hidden;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 #ff00c1;
  animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow:
    -2px 0 #00fff9,
    2px 2px #ff00c1;
  animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(10% 0 80% 0);
  }
  20% {
    clip-path: inset(50% 0 30% 0);
  }
  40% {
    clip-path: inset(25% 0 65% 0);
  }
  60% {
    clip-path: inset(70% 0 10% 0);
  }
  80% {
    clip-path: inset(40% 0 45% 0);
  }
  100% {
    clip-path: inset(85% 0 5% 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(85% 0 5% 0);
  }
  20% {
    clip-path: inset(40% 0 45% 0);
  }
  40% {
    clip-path: inset(70% 0 10% 0);
  }
  60% {
    clip-path: inset(25% 0 65% 0);
  }
  80% {
    clip-path: inset(50% 0 30% 0);
  }
  100% {
    clip-path: inset(10% 0 80% 0);
  }
}

@keyframes glitch-skew {
  0% {
    transform: skewX(0deg);
  }
  10% {
    transform: skewX(0.5deg);
  }
  20% {
    transform: skewX(-0.5deg);
  }
  30% {
    transform: skewX(0.2deg);
  }
  40% {
    transform: skewX(-0.2deg);
  }
  50% {
    transform: skewX(0deg);
  }
  100% {
    transform: skewX(0deg);
  }
}

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  animation: scan 0.2s linear infinite;
}

.login-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  padding: 40px;
  background: rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  z-index: 2;
}

.login-box h2 {
  margin: 0 0 30px;
  padding: 0;
  color: #fff;
  text-align: center;
}

.login-box .input-box {
  position: relative;
}

.login-box .input-box input {
  width: 100%;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  margin-bottom: 30px;
  border: none;
  border-bottom: 1px solid #fff;
  outline: none;
  background: transparent;
}

.login-box .input-box label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  pointer-events: none;
  transition: 0.5s;
}

.login-box .input-box input:focus ~ label,
.login-box .input-box input:valid ~ label {
  top: -25px;
  left: 0;
  color: #03e9f4;
  font-size: 12px;
}

.send-code-btn {
  position: absolute;
  right: 0;
  top: 0;
  background: #03e9f4;
  color: #031321;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.3s;
}

.send-code-btn:hover {
  background: #fff;
}

.send-code-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

.submit-btn {
  position: relative;
  display: inline-block;
  padding: 10px 20px;
  color: #03e9f4;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  overflow: hidden;
  transition: 0.5s;
  margin-top: 40px;
  letter-spacing: 4px;
}

.submit-btn:hover {
  background: #03e9f4;
  color: #fff;
  border-radius: 5px;
  box-shadow:
    0 0 5px #03e9f4,
    0 0 25px #03e9f4,
    0 0 50px #03e9f4,
    0 0 100px #03e9f4;
}

.submit-btn span {
  position: absolute;
  display: block;
}

.submit-btn span:nth-child(1) {
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #03e9f4);
  animation: btn-anim1 1s linear infinite;
}

@keyframes btn-anim1 {
  0% {
    left: -100%;
  }
  50%,
  100% {
    left: 100%;
  }
}

.submit-btn span:nth-child(2) {
  top: -100%;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #03e9f4);
  animation: btn-anim2 1s linear infinite;
  animation-delay: 0.25s;
}

@keyframes btn-anim2 {
  0% {
    top: -100%;
  }
  50%,
  100% {
    top: 100%;
  }
}

.submit-btn span:nth-child(3) {
  bottom: 0;
  right: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(270deg, transparent, #03e9f4);
  animation: btn-anim3 1s linear infinite;
  animation-delay: 0.5s;
}

@keyframes btn-anim3 {
  0% {
    right: -100%;
  }
  50%,
  100% {
    right: 100%;
  }
}

.submit-btn span:nth-child(4) {
  bottom: -100%;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(360deg, transparent, #03e9f4);
  animation: btn-anim4 1s linear infinite;
  animation-delay: 0.75s;
}

@keyframes btn-anim4 {
  0% {
    bottom: -100%;
  }
  50%,
  100% {
    bottom: 100%;
  }
}

/* --- 登录特效样式 --- */
.login-effect {
  display: none; /* 默认隐藏 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 100;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  font-size: 2em;
  text-align: center;
}

.login-effect p {
  opacity: 0;
  animation: fadeInText 1s 1.5s forwards;
}

@keyframes fadeInText {
  to {
    opacity: 1;
  }
}

/* --- 黑钻特效 --- */
#black-diamond-effect .diamond-shatter {
  position: relative;
  width: 200px;
  height: 200px;
}

#black-diamond-effect p {
  text-shadow:
    0 0 15px #fff,
    0 0 25px #00fff9;
}

.diamond-shatter::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 1) 0%,
    rgba(200, 240, 255, 1) 50%,
    rgba(0, 255, 249, 0) 70%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: diamond-burst 1s forwards;
}

.diamond-shatter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  animation: diamond-ring 1.5s 0.5s forwards;
}

/* 新增：冲击波效果 */
.diamond-shatter .shockwave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #00fff9;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0.7;
  animation: shockwave-effect 2s 0.2s forwards;
}

/* 新增：粒子效果容器 */
.diamond-shatter .particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 新增：单个粒子样式 */
.diamond-shatter .particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: #00fff9;
  border-radius: 50%;
  opacity: 0;
  animation: particle-explosion 1.5s forwards;
}

@keyframes diamond-burst {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(3.5);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

@keyframes diamond-ring {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0;
  }
}

/* 新增：冲击波动画 */
@keyframes shockwave-effect {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(7);
    opacity: 0;
  }
}

/* 新增：粒子爆炸动画 */
@keyframes particle-explosion {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(0);
    opacity: 0;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .login-container {
    width: 90%;
    padding: 20px;
  }

  .login-box h2 {
    font-size: 1.5em;
  }

  .login-box .input-box input,
  .login-box .input-box label {
    font-size: 14px;
  }

  .submit-btn {
    font-size: 14px;
    padding: 8px 16px;
    margin-top: 20px;
  }
}
