/* ============ 全局 ============ */
:root {
  --cyan: #00f0ff;
  --purple: #a855f7;
  --bg: #05060f;
  --panel: rgba(13, 18, 38, 0.55);
  --line: rgba(0, 240, 255, 0.25);
  --text: #d7e3f4;
  --muted: #7d8db0;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* 扫描线 */
.scanline {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    rgba(0, 240, 255, 0.015) 3px 4px
  );
  mix-blend-mode: screen;
}

/* 透视地板网格 */
.grid-floor {
  position: fixed;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 45vh;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 240, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(420px) rotateX(62deg);
  animation: floorMove 6s linear infinite;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
@keyframes floorMove {
  from { background-position: 0 0; }
  to { background-position: 0 48px; }
}

/* HUD 四角 */
.hud-corner {
  position: fixed;
  width: 56px;
  height: 56px;
  z-index: 3;
  border: 2px solid var(--line);
  pointer-events: none;
}
.hud-corner.tl { top: 18px; left: 18px; border-right: 0; border-bottom: 0; }
.hud-corner.tr { top: 18px; right: 18px; border-left: 0; border-bottom: 0; }
.hud-corner.bl { bottom: 18px; left: 18px; border-right: 0; border-top: 0; }
.hud-corner.br { bottom: 18px; right: 18px; border-left: 0; border-top: 0; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22ff9a;
  box-shadow: 0 0 8px #22ff9a;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }

/* ============ 登录页 ============ */
.login-wrap {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 92vw);
  padding: 48px 40px 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 0 40px rgba(0, 240, 255, 0.08),
    inset 0 0 60px rgba(168, 85, 247, 0.05);
  position: relative;
  animation: cardIn 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.login-card::before, .login-card::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--cyan);
  filter: drop-shadow(0 0 6px var(--cyan));
}
.login-card::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.login-card::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.login-logo { text-align: center; margin-bottom: 14px; }
.login-logo svg { filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5)); animation: spinSlow 14s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }

.login-title {
  text-align: center;
  font-size: 24px;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--cyan), #fff, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-subtitle {
  text-align: center;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--muted);
  margin: 8px 0 34px;
}

.field { position: relative; margin-bottom: 30px; }
.field input {
  width: 100%;
  padding: 10px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(125, 141, 176, 0.4);
  color: #fff;
  font-size: 15px;
  outline: none;
  letter-spacing: 1px;
}
.field label {
  position: absolute;
  left: 2px;
  top: 10px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
  transition: 0.25s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: -14px;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 2px;
}
.field-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 8px var(--cyan);
  transition: 0.3s;
  transform: translateX(-50%);
}
.field input:focus ~ .field-line { width: 100%; }

.btn-login {
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 6px;
  color: #031018;
  font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), #4cc9f0, var(--purple));
  background-size: 200% 100%;
  transition: 0.4s;
  position: relative;
  overflow: hidden;
}
.btn-login:hover {
  background-position: 100% 0;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.45);
  transform: translateY(-1px);
}
.btn-login::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0% { left: -80%; } 45%, 100% { left: 130%; } }

.btn-login .btn-loading { display: none; align-items: center; justify-content: center; gap: 8px; }
.btn-login.loading .btn-text { display: none; }
.btn-login.loading .btn-loading { display: inline-flex; }
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(3, 16, 24, 0.3);
  border-top-color: #031018;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-hint {
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}
.login-status {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.login-status b { color: var(--cyan); }
.login-status .sep { margin: 0 8px; opacity: 0.5; }

.shake { animation: shake 0.4s; }
@keyframes shake {
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

/* ============ 实验中心页 ============ */
.dash-page { position: relative; z-index: 1; }

.dash-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(5, 6, 15, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-size: 17px; letter-spacing: 2px; font-weight: 700; }
.brand-en { font-size: 10px; letter-spacing: 3px; color: var(--muted); }

.user-area { display: flex; align-items: center; gap: 16px; }
.user-badge { font-size: 13px; color: var(--muted); }
.user-badge b { color: var(--cyan); }
.btn-logout {
  padding: 7px 18px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 2px;
  transition: 0.25s;
}
.btn-logout:hover {
  border-color: #ff4d6d;
  color: #ff4d6d;
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.35);
}

.dash-hero { text-align: center; padding: 64px 20px 26px; position: relative; z-index: 5; }
.glitch {
  font-size: 46px;
  letter-spacing: 14px;
  position: relative;
  display: inline-block;
  background: linear-gradient(90deg, var(--cyan), #fff 55%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: flicker 4s infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.4; transform: translateX(2px); }
  94% { opacity: 1; transform: none; }
  96% { opacity: 0.6; }
  97% { opacity: 1; }
}
.dash-hero p { margin-top: 14px; color: var(--muted); letter-spacing: 3px; font-size: 13px; }

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
  padding: 18px 0 8px;
  position: relative;
  z-index: 5;
}
.stat { text-align: center; }
.stat b {
  display: block;
  font-size: 26px;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
  letter-spacing: 1px;
}
.stat span { font-size: 12px; color: var(--muted); letter-spacing: 2px; }

.lab-grid {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
  max-width: 1180px;
  margin: 44px auto 70px;
  padding: 0 28px;
}

.lab-card {
  position: relative;
  padding: 30px 26px 24px;
  background: var(--panel);
  border: 1px solid rgba(125, 141, 176, 0.22);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  overflow: hidden;
  animation: cardIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.1) backwards;
}
.lab-card:nth-child(1) { animation-delay: 0.05s; }
.lab-card:nth-child(2) { animation-delay: 0.12s; }
.lab-card:nth-child(3) { animation-delay: 0.19s; }
.lab-card:nth-child(4) { animation-delay: 0.26s; }
.lab-card:nth-child(5) { animation-delay: 0.33s; }
.lab-card:nth-child(6) { animation-delay: 0.40s; }

.lab-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, var(--cyan), transparent 40%, transparent 60%, var(--purple));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}
.lab-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 240, 255, 0.14);
}
.lab-card:hover::before { opacity: 1; }

.lab-icon {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(168, 85, 247, 0.12));
  border: 1px solid var(--line);
  transition: 0.3s;
}
.lab-card:hover .lab-icon {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  transform: scale(1.06) rotate(-3deg);
}
.lab-no {
  position: absolute;
  top: 22px;
  right: 24px;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--muted);
}
.lab-name { font-size: 19px; letter-spacing: 2px; margin-bottom: 10px; }
.lab-desc { font-size: 13px; color: var(--muted); line-height: 1.7; min-height: 44px; }
.lab-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(125, 141, 176, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tag-dev {
  font-size: 11px;
  letter-spacing: 2px;
  color: #ffb020;
  border: 1px solid rgba(255, 176, 32, 0.45);
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255, 176, 32, 0.08);
}
.lab-enter {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--cyan);
  opacity: 0;
  transform: translateX(-8px);
  transition: 0.3s;
}
.lab-card:hover .lab-enter { opacity: 1; transform: none; }

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(3, 4, 10, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  width: min(440px, 90vw);
  padding: 42px 38px 34px;
  text-align: center;
  background: rgba(10, 14, 30, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.15), 0 30px 60px rgba(0,0,0,0.6);
  transform: scale(0.85) translateY(24px);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
.modal-mask.show .modal { transform: none; }

.modal-radar {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle, rgba(0,240,255,0.08), transparent 70%);
}
.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0, 240, 255, 0.5), transparent 22%);
  animation: radar 2.4s linear infinite;
}
@keyframes radar { to { transform: rotate(360deg); } }

.modal-title { font-size: 20px; letter-spacing: 2px; margin-bottom: 12px; }
.modal-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 3px;
  color: #ffb020;
  border: 1px solid rgba(255, 176, 32, 0.5);
  background: rgba(255, 176, 32, 0.1);
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
  text-shadow: 0 0 10px rgba(255, 176, 32, 0.6);
}
.modal-desc { font-size: 13px; color: var(--muted); line-height: 1.9; margin-bottom: 24px; }

.progress {
  height: 8px;
  border-radius: 6px;
  background: rgba(125, 141, 176, 0.18);
  overflow: hidden;
  margin-bottom: 26px;
}
.progress-bar {
  height: 100%;
  width: 38%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  animation: prog 2.6s ease-in-out infinite;
}
@keyframes prog {
  0% { width: 18%; }
  50% { width: 72%; }
  100% { width: 18%; }
}

.btn-close {
  padding: 11px 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cyan);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 3px;
  transition: 0.25s;
}
.btn-close:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.3);
}

.dash-footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 22px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(125, 141, 176, 0.6);
  border-top: 1px solid rgba(125, 141, 176, 0.12);
}

@media (max-width: 640px) {
  .glitch { font-size: 30px; letter-spacing: 8px; }
  .stats-bar { gap: 28px; }
  .dash-header { padding: 12px 16px; }
  .brand-name { font-size: 14px; }
}
